kermit
Registered User.
- Local time
- Today, 13:45
- Joined
- Dec 20, 2002
- Messages
- 12
this one has me baffled.
I have created stuff like this many times before, but this one comes up with an error: "Type-Declaration character does not match declared data type.
all i am doing is creating a recordset and i want to get the values out of the record that it finds.
any ideas???
it errors out on the last line on the "rs!".
here is my code:
Dim db As Database
Dim rs As Recordset
Dim strsql As String
Dim number_of_uses As String
scan = Me.ScanID
firstletter = Left(scan, 1)
If firstletter = "t" Then
scan = Mid(scan, 2, Len([scan]))
End If
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT distinctrow [Master File].* FROM [Master File] WHERE ((([Master File].[Tool Serial Number])=""" & scan & """) AND (([Master File].Status)=""Active""));", dbOpenDynaset)
If rs.RecordCount = 0 Then
MsgBox "Incorrect Tool Serial Number"
Exit Sub
End If
number_of_uses = rs!([Number of Uses(if by usage)])
thanks for your help!
-kermit
I have created stuff like this many times before, but this one comes up with an error: "Type-Declaration character does not match declared data type.
all i am doing is creating a recordset and i want to get the values out of the record that it finds.
any ideas???
it errors out on the last line on the "rs!".
here is my code:
Dim db As Database
Dim rs As Recordset
Dim strsql As String
Dim number_of_uses As String
scan = Me.ScanID
firstletter = Left(scan, 1)
If firstletter = "t" Then
scan = Mid(scan, 2, Len([scan]))
End If
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT distinctrow [Master File].* FROM [Master File] WHERE ((([Master File].[Tool Serial Number])=""" & scan & """) AND (([Master File].Status)=""Active""));", dbOpenDynaset)
If rs.RecordCount = 0 Then
MsgBox "Incorrect Tool Serial Number"
Exit Sub
End If
number_of_uses = rs!([Number of Uses(if by usage)])
thanks for your help!
-kermit