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

Unbound Report with many sub reports wont display

Status
Not open for further replies.

spartansFC

Programmer
Apr 1, 2009
165
GB
Hi

I've used this method loads of times to open reports etc but for some reason i'm doing something wrong and i can't figure out why.

I've created a list box which lists all my reports, i double click on the report name and the report opens. On the report i'm working on, i have a form which opens up before the report so that i can add from and to dates, there's a preview button on that pop up form which when you click is supposed to then open the report.

I've messed around abit trying to figure out what is going on and i don't think the queries are getting passed through to the report or something else is going on.

I've attached a jumbled screen shot of what happens, the grey box on the right hand side is what happens at the minute when the report is displayed.

When you double click on the report in the list box, a macro is called up where:

The action is : Open Report
The report name is: =[Forms]![frmViewReports]![lstReferralReports]
View is: print preview

the code below is on the open event of the report so that the pop up form kicks in:

Code:
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmMonitoringDatesSelection", , , , , acDialog, "Monitoring Report"
    If Not IsLoaded("frmMonitoringDatesSelection ") Then
        Cancel = True
 End If
End Sub

When you click the preview button the code is:

Code:
If IsNull([txtboxSummaryStartDate]) Then
        MsgBox "You must enter a Start Date"
        DoCmd.GoToControl "txtboxSummaryStartDate"
    Else
        Me.Visible = False
    End If
End Sub

The report is made up of a unbound main report with a few sub reports as it’s a summary report, age and gender profiles etc. I did originally have the date selection boxes on my main menu with just a command button that called the report up which worked fine, but since updating the database, i've changed a few things, but i've used this method before and never had this problem.

screenshotget.jpg


Any ideas

thanks

Mikie
 
I think this solution of opening the dialog form in the On Open event of the report is backwards. I always open a form and set the criteria first. Then I have a command button that opens the report that uses the criteria.

I think your issue is one of timing of the open event of the main report vs the subreports.

Duane
Hook'D on Access
MS Access MVP
 

I understand what you're saying but i've used this method of the On open event before on previous reports and it works fine, i'm not sure if it's because the main report is unbound.

 

I think this is the first time i've used this method on an unbound report.

All my previous reports, the main reports has had a query or table as it's source.

So i think i've found out why it's not working, i just need to figure out a way round it.

Mikie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top