Hi there,<BR><BR>I am trying to create an advanced search for a library database. I have created an sql statement that is generated by user input (search type/criteria). What I need to do now is specify what results to show depending on what type of search.<BR><BR>i.e<BR><BR>display author name if the user has searched authors.<BR><BR>i have tried to do it like this;If searchtype1="[Main Author]" then<BR>search1value="[Main Author].[First Name] LIKE &#039;%" & search1a & "%&#039; AND [Main Author].[Surname] LIKE &#039;%" & search1b & "%&#039; " <BR>From1value="Left JOIN [Main Author] ON Main.ref = [Main Author].ref"<BR>select1value=", [Main Author].[Surname], [Main Author].[First Name]"<BR>show1value= objrs("first name") & " " & objrs("surname") <BR><BR>but this just shows a syntax error. Can anyone see what I am doing wrong?<BR><BR>Thanks<BR><BR>Russell<BR><BR>