Query with "AND"
Posted on 2003-10-31
I'm trying to write a query in my Visual Basic application (Access as a database) as follow:
strSQL = "SELECT * FROM qryLearnerwithCourses "
strSQL = strSQL & "WHERE (qryLearnerwithCourses.Learner_ID = '"txtlearnerid.Text"') and (qryLearnerwithCourses.WCB_ID = '"companywcb.Text"') "
visual basics doesn't like this statement. after moving away from that line i get the error: "expected end of statement" and it changes the color of this code to red.
do you know what i'm doing wrong?