By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,078 Members | 2,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,078 IT Pros & Developers. It's quick & easy.

I'm doing something wrong with OpenRecordset???

P: n/a
MLH
When the following runs, I get error saying "Jet can't find input
table/query qdfMarkedAddnlOwnerRecs" The error occurs in
line #150 Sub cmdSaveVehicleRec_Click() frmVehicleEntryForm.

120 Set MyDB = CurrentDb ' Set MyDB =
OpenDatabase("Northwind.mdb") is alternate syntax.
140 With MyDB
149 Set qdfMarkedAddnlOwnerRecs =
..CreateQueryDef("NewQueryDef", "Select * From tblAddnlOwners Where
[AOActionMark]=True;")
150 Set rstMarkedAddnlOwners =
..OpenRecordset("qdfMarkedAddnlOwnerRecs", dbOpenSnapshot)
230 With rstMarkedAddnlOwners
240 .MoveFirst
250 Do Until rstMarkedAddnlOwners.EOF

What exactly have I done wrong?
Mar 24 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
MLH schreef:
When the following runs, I get error saying "Jet can't find input
table/query qdfMarkedAddnlOwnerRecs" The error occurs in
line #150 Sub cmdSaveVehicleRec_Click() frmVehicleEntryForm.

120 Set MyDB = CurrentDb ' Set MyDB =
OpenDatabase("Northwind.mdb") is alternate syntax.
140 With MyDB
149 Set qdfMarkedAddnlOwnerRecs =
.CreateQueryDef("NewQueryDef", "Select * From tblAddnlOwners Where
[AOActionMark]=True;")
150 Set rstMarkedAddnlOwners =
.OpenRecordset("qdfMarkedAddnlOwnerRecs", dbOpenSnapshot)
230 With rstMarkedAddnlOwners
240 .MoveFirst
250 Do Until rstMarkedAddnlOwners.EOF

What exactly have I done wrong?


For starters, sticking to a single thread might help.

What happens when you use clean syntax like:

With CurrentDb
With .CreateQueryDef("", "Select * From tblAddnlOwners Where
[AOActionMark]=True;")
With .OpenRecordset(dbOpenSnapshot)
yada yada

Also, consider Alberts remark if the actual code really is that simple.
Mar 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.