Help... I've been asked to do a VB6.0 program. I'm required to enter values in a database that will be queried later on. Unfortunately, I can't seem to get the code right.
This is what this part of the program should do:
1. Get the name to be searched
2. Take the entered name and compare it with the values in the database.
3. If the entered name is equivalent to a certain value in the database, it will then proceed to get other information (in this case, a field with a date) and put it on the list box...
Well, I don't seem to have explained that properly but I hope you can help me. The code might look really lame and the error is on the bold text so far.
Dim searchname
Private Sub cmdgo_Click()
searchname = txtsearchname.Text
Set mydb1 = OpenDatabase(App.Path & "\parlordb.mdb")
Set myrs1 = mydb1.OpenRecordset("parlordb")
[B]myrs1.Open ("select * from parlordb where custname=searchname")[/B]
Do Until myrs1.EOF
lstdate.AddItem (myrs1!custdate)
myrs1.MoveNext
Loop
myrs1.Close
End Sub
Thank you in advance!