Access 2007 crashes when I use this macro to open/print reports

  • Thread starter Thread starter forest8
  • Start date Start date
F

forest8

Hi there

One of my reports consists of two separate reports. This is my macro to
print the report out but as I mentioned in the subject, Access 2007 keeps
crashing.

How do I fix my error:

Private Sub Print_Click()

Dim strDocName As String
Dim strWhere As String
strDocName = "R2-2a GPS_Youth"
strWhere = "Youth_ID=" & Me.Youth_ID
DoCmd.OpenReport "R2-2a GPS_Youth", acPrint, , strWhere
strDocName = "R2-2b GPS_Youth"

End Sub


I can't even print out the first part of my report yet alone both parts.

The two parts of my report is one single table with over 50 variables. I
know I should have normalized my table but to do that as this junction would
take more time than I can afford.

Please any advice is greatly appreciated.

Youth_ID
 
Forest,

First of all, this is not a macro. You are doing this in a VBA procedure,
which is a different kettle of fish.

What does "crashing" mean, in this context? Are you getting an error
message? If so, what does it say?

Is "R2-2a GPS_Youth" the correct name for the report? Is there a field in
the report named Youth_ID?

Where is the Print command button? Earler, you mentioned a subform. Is the
subform where the required Youth_ID reference field is? If so, is the
command button on the subform or the main form?
 
Hi


When I try to print this report, Access 2007 closes and I get an error
message to send the issue to Microsoft. It reopens the database and creates a
backup.

Yes. R2-2a GPS_Youth" the correct name for the report. There is a field in
the report named Youth_ID. And yes, there is a field in the subform named
Youth_ID.

The print button is on the subform.
 
Back
Top