I'm making a form to add some records to my database & I've some problem. If user fill the field called 'Product' I'd like to inform him by making visible one picture that this product is in database. (I just want to inform him - not to ban option of adding)
I've this code, and unfortunately it give me an error (Run-time error no operator)
Private Sub ProductText_LostFocus()
Dim cnn as New ADODB.Connection
Dim strSQL as String
Dim rs as New ADODB.Recordset
Set cnn = CurrentProject.Connection
strSQL = "Select Product FROM Shopping WHERE Product = " & ProductText.Value
Set rs = cnn.Execute(strSQL)
If rs.RecordCount > 0 then
ShowPicture.Visible = True
End if
End sub
What I do wrong?