hello,
I have a little problem. I have one table and I want the user to search if a value already exist. He/she types the value in a textbox and then push a button what starts the code. However, my code only find the first record of the table.
Can someone help me with this 'loop-problem'?
Thanks in advantage,
Albert.
Here goes my simplified code:
Dim rstthumbs As Recordset
Dim dbs As Database
Set dbs = CurrentDb()
Set rstthumbs = dbs.OpenRecordset("SELECT naam FROM Thumbnails")
zoeknaam.SetFocus 'this is the textbox
If rstthumbs("naam") = zoeknaam.Text Then
MsgBox "Gevonden"
Else
MsgBox "Niet gevonden"
End If
I have a little problem. I have one table and I want the user to search if a value already exist. He/she types the value in a textbox and then push a button what starts the code. However, my code only find the first record of the table.
Can someone help me with this 'loop-problem'?
Thanks in advantage,
Albert.
Here goes my simplified code:
Dim rstthumbs As Recordset
Dim dbs As Database
Set dbs = CurrentDb()
Set rstthumbs = dbs.OpenRecordset("SELECT naam FROM Thumbnails")
zoeknaam.SetFocus 'this is the textbox
If rstthumbs("naam") = zoeknaam.Text Then
MsgBox "Gevonden"
Else
MsgBox "Niet gevonden"
End If