Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why am I getting a Type mismatch error when opening this recordset

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Trying to open in Access 97 code

Dim DBS As Database
Dim rst As Recordset
Dim strsql As String
Dim MaxID As Long
Dim NewLabelCount As Long
Dim NewLabelID As String
Dim x As Integer
Dim MaxIDLen As Long


txtLabelCount.SetFocus
NewLabelCount = txtLabelCount.Text

Set DBS = CurrentDb
cboCategory.SetFocus
strsql = "Select MaxAssigned from Asset_Label_Sequence where Prefix = '" & cboCategory.Text & "'"
Set rst = DBS.OpenRecordset(strsql)
 
Hi!

Is prefix a text field? If it isn't then you need to drop the single quotes and everything after and including the last ampersand

hth Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top