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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mismatch error???

Status
Not open for further replies.

Telsa

Programmer
Jun 20, 2000
393
US
I'm getting a mismatch error at the line with ----> and don't know why. Can anyone see what I'm missing?

Sub test()
Dim db As Database
Dim recSubmittal As Recordset
Dim recFiles As Recordset
Dim strSQL As String
Dim strSQL2 As String

' Capture the current record's prodnum
' strProdNum = Me.ProdNum

strSQL = "SELECT * FROM qrySubmittalMerge WHERE prodnum = 'lj584';"

' setup recordsets to equal queries and filter by prodnum
Set db = CurrentDb()
-----> Set recSubmittal = db.OpenRecordset(strSQL, dbOpenDynaset)


End Sub
[sig][/sig]
 
HI

ProdNum

strSQL = "SELECT * FROM qrySubmittalMerge WHERE prodnum = 'lj584';

i'm not 100% sure but the way you are setting the where clause might be the problem

try

strSQL = "SELECT * FROM qrySubmittalMerge WHERE prodnum = "
strSQL = strSQL & """" & "lj584" & """"
strSQL = strSQL & ";"
this should add "" arround the item lj584

HTH [sig]<p>Robert Dwyer<br><a href=mailto:rdwyer@orion-online.com.au>rdwyer@orion-online.com.au</a><br>[/sig]
 
I found it was the DAO vs ADO conumdrum. Ughh..

This database was recently converted from Access 97 which of course uses DAO. So I have to specifically state for the recordset to be DAO.

Mary :eek:} [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top