473,382 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

I'm doing something wrong with OpenRecordset???

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
1 1625
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: el Benno | last post by:
If CurrentDb.OpenRecordset("table").EOF Then ... works fine If CurrentDb.OpenRecordset("Query").EOF Then ... doesn't????????? microsft help is outstanding too - surprise surprise any help...
5
by: Philippa | last post by:
I'm trying to access data in vba using the openrecordset command. The data in on a SQL Server 2000 database, and I have linked tables to that data. the Table I'm trying to access is one of these...
5
by: Koen | last post by:
Hi all, I am experimenting with DAO. I wrote this sub to update one specific field of one specific row in one specific table. Nothing wrong with the SQL statement, but when I execute this I get...
7
by: Geert Elias | last post by:
Hello all, When making a new table by running a make table query based on a table, the field I added a descending sort, is not always sorted correct. When I run the query 10 times, almost 7...
3
by: u473 | last post by:
Can you show me where I went wrong ? Thank you Private Sub Command1_Click() Dim db As DAO.Database Dim rsTable1 As DAO.Recordset Dim rsTable2 As DAO.Recordset Set db = CurrentDb Set rsTable1...
0
by: mo. | last post by:
I need some help in accessing Jet database using DAO. I have just started to learn c# and am trying to rewrite a program I have in vb.net to c#. In VB.Net I can do this: Dim ws As...
5
by: Sunnyrain | last post by:
I am developing a program in Access 2000. I couldn't make OpenRecordset method work right. It's working when I opened a simple SQL query below in OpenRecordset. ..... Dim dbs As Database, rst...
11
by: Shawn Yates | last post by:
I downloaded TimeLines.zip from (http://www.mvps.org/access/reports/rpt0018.htm) and I think I found a bug in it but I can't seem to fix it. When you open this go to the table and enter a new...
7
by: mirandacascade | last post by:
The questions are toward the bottom of this post. Situation is this: 1) Access 97 2) Multi-user appplication 3) SQL Server 2000 4) Sporadically (i.e. less than 1% of the time) encounter the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.