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

problems with report.recordsource

Status
Not open for further replies.

alfalf

Programmer
Mar 6, 2003
155
BA
Hello.

I have one db -> db1.mdb with only one table in it: tbl

Here's my code (under Report_open):

Code:
Dim CSQL as String
CSQL = "SELECT * from tbl;"

Dim [green]workjet2[/green] As DAO.Workspace, [blue]contbl[/blue] As DAO.Database
Set workjet2 = CreateWorkspace("NewJetWorkspace", "admin", "a", dbUseJet)
Set contbl = [green]workJET2[/green].OpenDatabase("C:\construction\db1.mdb", False, False, "MS Access")

Report.RecordSource = [blue]contbl[/blue].OpenRecordset(CSQL, dbOpenForwardOnly, dbReadOnly).Name

Me.GroupLevel(0).ControlSource = "accent_name"
Me.GroupLevel(0).SortOrder = False

It connects to db1.mdb but it returns error message:
[red]
Microsoft Jet database ngine cannot find the input table or query 'tbl'. Make sure it exists...
[/red]

What could be the cause?

Any help is appereciated.
 
rename your table tbl is probally reserved

Hope this helps
Hymn
 
No it's not a problem.

This is actually an example. Real code is the same but I use for example cities_us_pa table name instead.

And same problem appears: ms jet dbengine cannot find cities_us_pa input table...

(in real example, it's another database too).

?
Could it be DAO?
Is my suspection on wrong references possible?
I must say that I have no problem making connections for form lists recordsets, the problem is only on report. Am I missing something?

My references are:
VBA
MS Acc 9.0 Object Library
OLE Automation
MS ADOX 2.1 Objects Library
MS DAO 3.6 Objects Library
MS Win Common Controls 6.0 SP6
MS Common Dialog Controls 6.0 SP3

They're carefully choosen and I use all their objects / methods in my app.

Any help appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top