View Full Version : Crosstab query report problem


jpatton
11-22-2006, 04:20 PM
Anyone have any suggestions to solve the following?

I have a report that includes several subreports. The parameters for the report and underlying query (including subqueries) are entered from a form. This works just fine except when I try to add a crosstab query to the main query. The query works great. The problem is that when I try and edit the main report, dialog boxes keep popping up asking for the parameters. It doesn't matter if I respond to the dialog boxes or not (i.e. enter a value, close the box, hit the cancel or ok buttons). The dialog boxes never seem to stop popping up every few moments.

Any suggestions?

Thanks in advance for your help.

Rich
11-22-2006, 11:39 PM
You have to define the Parameters for the crosstab query

jpatton
11-27-2006, 10:00 AM
Rich,

Thank you!

I added the parameters as suggested, unfortunately, it didn't clear up the problem.

Any other thoughts?

Regards,
J. Patton

Rich
11-27-2006, 11:00 AM
What are the parameters of your query?

jpatton
11-27-2006, 04:07 PM
Rich,

Parameters:
- [employee abbreviation] text field
- [close date] date/time field

I am using a custom form to enter the values of the fields, so the fully qualified parameter name would be: [Forms]![formname]![parametername]

Thanks,
J. Patton

Rich
11-27-2006, 10:15 PM
Is the Form kept open while the report opens?

jpatton
11-29-2006, 06:14 PM
Yes, I believe it is. I copied the VB code straight from the MS website:

On Close:

Private Sub Report_Close()

DoCmd.Close acForm, "form name"

End Sub

On Open:

Private Sub Report_Open(Cancel As Integer)

' set public variable to true to indicate that the report is in the open event
functionsAndPublicVariables.bInReportOpenEvent = True

DoCmd.OpenForm "form name", , , , , acDialog

' Cancel report if user clicked the cancel button
If functionsAndPublicVariables.IsLoaded("form name") = False Then Cancel = True

' set public variable to false to indicate that the open event is completed
functionsAndPublicVariables.bInReportOpenEvent = False

End Sub

Thanks!

J. Patton

Rich
11-30-2006, 12:03 PM
You need the Form open before the Report opens