Open a report with a button

BartK

Registered User.
Local time
Today, 13:00
Joined
Jun 7, 2013
Messages
115
Hello all,
I'm having a little trouble getting this accomplished. I can instruct access to print the report, however I just want to be able to view the report after I select a button. I will attach a picture so you can see what I have thus far. I do have an older version of this and it works flawlessly and as far as I can tell everything is a carbon copy of the working version.

Please look over and give me some pointers as to what I am doing wrong. I have a feeling it is something very simple that I am missing. Thanks
 

Attachments

  • open report.jpg
    open report.jpg
    93 KB · Views: 102
You want...

acPreview or it might be acViewPreview instead of acViewNormal
 
I've tried both variations of it and still no progress. Currently here is what I have behind the button

DoCmd.OpenReport "Report1", acViewPreview, , "Citation = '" & Me.Citation & "'"

And it spits back the error on the picture attached to this reply. :banghead::banghead::banghead:
 

Attachments

  • acviewreport.JPG
    acviewreport.JPG
    48.3 KB · Views: 96
IMHO -Buttons on a report = bad design...
 
That image does not mean it can't Preview it just means you need to change the Margins because the Report is larger than the paper.
 
I agree that buttons on a report are not that great of an idea, however not my choice. The people who make a heck of a lot more money around here than I do want it done.

I don't want to print it out just review it on a report is all. Still have anything to do with the margins?
 
Yes, because you are using a Report and as far as it's concerned you want to print it. So, you could try setting the margins to 0" (which it should then automatically reset to the minimum) and see if that helps. If not, try slecting a large paper size for that report only BUT if you go to print it you will have a problem.
 
I did find something out though, whenever I changed the primary key from number to text it did show the report then. However when I changed it back to a number format it still gives me the error messages that I have listed previously. Thank you everyone for your help. I may have to see if there is a way that I can get it accomplished. Thank you once again.
 
The primary key has nothing to do with the margins so i'm not sure I understand that at all. Must have been a different message. The PK is probably related to *Citation*.
 
The primary key has nothing to do with the margins so i'm not sure I understand that at all. Must have been a different message. The PK is probably related to *Citation*.

Gina is right on here.

Bart you should reduce margins to only what you need first. Your first image you posted shows you are already using blank space.

Also, is there an invisible field to the right? Comparing your first image with the second it seems that the object in design view is not seen in report view. You might want to consider vertical adjustments to reduce the width. I have dealt with this extensively trying to fit 30 or more fields into one page.

Hope this helps in some way but Gina is right on here.
 

Users who are viewing this thread

Back
Top Bottom