Listbox Rowsource

S

Shannon

Hi All,

I have the following line of code that will not work and I can't for the
life of me work out why.

Forms!searchform!List12.RowSource = "SELECT MemberData.Surname,
MemberData.FirstName, MemberData.Code FROM MemberData WHERE
(((MemberData.Surname) Like " & Forms.searchform.Surname & " * ));"

I'm sure it is staring me in the face but he brain isn't working today.

Any assistance would be greatly apprciated.
 
S

Shannon

Thanks.

ruralguy via AccessMonster.com said:
Strings need to be enclosed within quotes.

WHERE MemberData.Surname Like '" & Forms.searchform.Surname & "'* ;"
 
Top