Hi there!
With the following VBA code, I'm trying to select the text value from a textbox and fill that in a query to select the code from a person. (a password only login). However, I'm getting a run time error 3078 at the '' Set rs = db.OpenRecordset("strSQL")'' line.
Does anybody know why this is not working properly?
Thank you!
With the following VBA code, I'm trying to select the text value from a textbox and fill that in a query to select the code from a person. (a password only login). However, I'm getting a run time error 3078 at the '' Set rs = db.OpenRecordset("strSQL")'' line.
Code:
Private Sub Tekst6_AfterUpdate()
Dim strSQL As String
Dim strBarcode As String
Set db = CurrentDb()
'strBarcode = Me.Tekst6
'MsgBox strBarcode
'MsgBox Me.Tekst6.Value
strSQL = "SELECT * FROM Personeel WHERE Barcode = Me.Tekst6.Value"
Set rs = db.OpenRecordset("strSQL")
If rs.RecordCount > 0 Then
'If Me.Tekst6 = "1" Then
DoCmd.OpenForm "frmNavigation"
Else
MsgBox "Barcode is wrong!", vbOKOnly
End If
End Sub
Does anybody know why this is not working properly?
Thank you!