Openargs not being populated

GoodyGoody

Registered User.
Local time
Today, 16:16
Joined
Aug 31, 2019
Messages
120
I have some VBA code:

Code:
DoCmd.OpenReport strReportName, acPreview, , , , "TESTING"

but when I inspect me.openargs in the report Load or Open event Me.Openargs shows as null. What am earth am i doing wrong?
 
Works for me.

Post your code from report.
 
...and make sure you are not opening the report from design view. Switching views is not the same as invoking the DoCmd method.
 
Code from the Report Open event. I notice that the report Load event is not firing. I put a break point in there but it doesn't fire. Is that a clue as to what is wrong?

Code:
Private Sub Report_Open(Cancel As Integer)
Dim intControlCount As Integer
Dim varOpenArgs As Variant

varOpenArgs = Me.OpenArgs
intControlCount = Nz(Me.OpenArgs, 0)
End Sub
 
Sorry it's been a while. I haven't been able to access the forum for over a week. It just kept crashing on me with 'Database error'. Thanks. That was just testing. The issue was that I was preprocessing the report for a crosstab query and it had been put in design mode. Having done the adjustments on the column data for the crosstab report I called the report in Preview mode but hadn't closed it beforehand so it was still in design mode and therefore not passing OpenArgs. Thanks for getting back though
 

Users who are viewing this thread

Back
Top Bottom