PC Review


Reply
Thread Tools Rate Thread

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

 
 
forest8
Guest
Posts: n/a
 
      12th Apr 2010
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

 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      13th Apr 2010
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?

--
Steve Schapel, Microsoft Access MVP


"forest8" <(E-Mail Removed)> wrote in message
news:57017CA9-E3A0-4642-987D-(E-Mail Removed)...
> 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
>

 
Reply With Quote
 
forest8
Guest
Posts: n/a
 
      13th Apr 2010
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.



"Steve Schapel" wrote:

> 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?
>
> --
> Steve Schapel, Microsoft Access MVP
>
>
> "forest8" <(E-Mail Removed)> wrote in message
> news:57017CA9-E3A0-4642-987D-(E-Mail Removed)...
> > 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
> >

> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A macro to do the open several reports to print forest8 Microsoft Access Macros 4 12th Apr 2010 02:55 PM
Printing a report defaulted to Print Preview crashes Access 2007 Rod Plastow Microsoft Access Reports 7 8th Apr 2009 06:49 PM
how do I print a list of available reports in Access 2007? Norwalker Microsoft Access Reports 3 6th Apr 2009 04:16 PM
Access crashes when I apply a filter to open a Macro. Frank The Novice Microsoft Access Reports 2 5th Mar 2009 05:26 PM
Print a form crashes Access 2007 djkc55 Microsoft Access Forms 0 28th Feb 2008 08:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:49 PM.