Hi,
All i'm trying to do is run an SQL statement, store it in a record set then right different values depending on whether any records are found or not.
The code I have at the moment is:
If Me.txtManagerNo <> "" Then
strSQL = "UPDATE dbo_Passwords SET password = 'password' WHERE (((dbo_Passwords.ManagerNo)=[forms]![frmpassword]![txtManagerNo]));"
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
If rst.EOF Then
MsgBox "Sorry, this is not a Manager Number. Please try again."
End If
Else ........
I'm getting an error saying "Invalid Operation" on the line Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
I'm quite new to VB so sorry if tehre is a really obvious mistake in there!
Thanks.
All i'm trying to do is run an SQL statement, store it in a record set then right different values depending on whether any records are found or not.
The code I have at the moment is:
If Me.txtManagerNo <> "" Then
strSQL = "UPDATE dbo_Passwords SET password = 'password' WHERE (((dbo_Passwords.ManagerNo)=[forms]![frmpassword]![txtManagerNo]));"
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
If rst.EOF Then
MsgBox "Sorry, this is not a Manager Number. Please try again."
End If
Else ........
I'm getting an error saying "Invalid Operation" on the line Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
I'm quite new to VB so sorry if tehre is a really obvious mistake in there!
Thanks.