i just want to know if it is possible in SQL select statement to have more than one column to be compared for the searchstring(recordsource) like for example select * from [Tablename] where lastname like ... AND firstname like ... because the VB is giving me a run time error TYPE MISMATCH when i use this "SELECT * from Trans where IsNull(DateReturned)=True" And "StudId like '" & Text1(8).Text & "'". Thanks in advance ^^

hi,

I didn't test it but i think you are adding extra "s. The statment shall look somthing like:
"SELECT * from Trans where IsNull(DateReturned)=True And StudId like '" & Text1(8).Text & "'"
Also I think IsNull will not work if u r using SQL server as database.

"SELECT * from Trans where IsNull(DateReturned)=True And StudId like '" & val(Text1(8).Text) & "'". put a val sign before the
(Text1(8).Text)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.