|
-
Feb 8th, 2006, 02:24 PM
#1
Thread Starter
Frenzied Member
Problem with calling Access Report from VB
Hey,
I have a report in Access that I am opening from VB using the access object reference. For some reason when I originally open it to preview from the VB app it shows no data. If I go into design and back to preview the data appears. If I just open the DB manually and double click the report the data shows up. Anyone know what might cause the data not to appear upon originally opening the report through VB?
Thanks
-
Feb 9th, 2006, 03:46 AM
#2
Re: Problem with calling Access Report from VB
Weird issue. What and where is the recordseource for the report? Are you using any filters? Can you post some of the code you use to open your report? What version of Access?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 9th, 2006, 08:00 AM
#3
Thread Starter
Frenzied Member
Re: Problem with calling Access Report from VB
The recordsource is straight from a table in Access 2000. There are no filters but I did set the report to sort by one of the columns.
Here is the VB code I use to call it:
[Highlight=VB]
Set acAPP = New Access.Application
acAPP.OpenCurrentDatabase App.Path & "\reporting.mdb"
acAPP.Visible = True
acAPP.DoCmd.OpenReport "Report_Name", acViewPreview
acAPP.DoCmd.Maximize
[\vbcode]
I use the same exact code to call a few other reports that work fine. The only thing is the other reports pull data from queries instead of a table.
-
Feb 9th, 2006, 08:06 AM
#4
Re: Problem with calling Access Report from VB
As RD has alreadt stated.. wierd Issue..
Could you try replacing the table name in the RecordSource of the report to a "SELECT * FROM tableName ORDER BY FieldName" instead and see if that resolves it.
It could be that the code is executing too quickly for the database to open the table's data, doubt this is it but worth a shot..
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Feb 9th, 2006, 08:10 AM
#5
Thread Starter
Frenzied Member
Re: Problem with calling Access Report from VB
Thanks for the suggestion... tried it but was unsuccessful.
-
Feb 9th, 2006, 08:15 AM
#6
Re: Problem with calling Access Report from VB
Another shot in the dark.. but have seen this issue with some of my own reports...
Check the printer that the report is assigned to.
What version of Access and operating system are you on?
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Feb 9th, 2006, 08:29 AM
#7
Thread Starter
Frenzied Member
Re: Problem with calling Access Report from VB
I am just previewing the report, so I don't think the printer should matter. I am using Access 2000 on Win XP.
-
Feb 9th, 2006, 09:12 AM
#8
Re: Problem with calling Access Report from VB
Believe it or not it will matter.. if the default printer that the report is linked to is unavailable it will not display.
in fact this is what I stumbled across when I started experiencing report problems on Win XP..
Default Printers in Office 2000
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|