OutputTo PDF in form (1 Viewer)

robruhr

Registered User.
Local time
Today, 12:03
Joined
Mar 2, 2009
Messages
11
I have a button on my form that has the macro "OutputTo PDF", so the form can be exported and saved as a PDF file. However, I don't want the button to be exported either. Is there a way to hide the button so it is not exported with the other elements on the form? I'm slowly learning VBA and Macros, so any help would be appreciated. Thanks.
 

ghudson

Registered User.
Local time
Today, 15:03
Joined
Jun 8, 2002
Messages
6,195
First you have to set the focus to another object since the button will have the focus once you clicked it. Then you can hide the button.

But I have to ask why you are saving the form to a PDF instead of using a report based on the data in the form and output the report to PDF instead?

Code:
YourOtherObjectNameHere.SetFocus
YourCommandButtonNameHere.Visible = True
 

boblarson

Smeghead
Local time
Today, 12:03
Joined
Jan 12, 2001
Messages
32,059
But I have to ask why you are saving the form to a PDF instead of using a report based on the data in the form and output the report to PDF instead?

^^^^^^^ +1 ^^^^^^^

Forms are meant for viewing and entering/editing data. Reports are meant for printing.
 

robruhr

Registered User.
Local time
Today, 12:03
Joined
Mar 2, 2009
Messages
11
First you have to set the focus to another object since the button will have the focus once you clicked it. Then you can hide the button.

But I have to ask why you are saving the form to a PDF instead of using a report based on the data in the form and output the report to PDF instead?

Code:
YourOtherObjectNameHere.SetFocus
YourCommandButtonNameHere.Visible = True

Thank you. But, do I put this code on the "on mouse down" or "on got focus", or somewhere else?
To answer your question about the form vs report, I don't know. I'm creating this database and learning as I go. I've been teaching myself how to do things in Access by trial and error. I understand that reports are made to print out, but I was hoping I could skip the step of creating a report, based on the exact look of the form, and then have to export it as a PDF. I'm sure it's probably easier that way from the way you asked your question. :) But, again, I'm learning.
 

robruhr

Registered User.
Local time
Today, 12:03
Joined
Mar 2, 2009
Messages
11
Hi, sorry, but I'm not sure where I should put the code you mentioned below. Thanks.
 

rodmc

Registered User.
Local time
Today, 19:03
Joined
Apr 15, 2010
Messages
514
just out of interest, why would you want to export a form?
 

robruhr

Registered User.
Local time
Today, 12:03
Joined
Mar 2, 2009
Messages
11
ghudson = Thanks, but the code is not working. It won't let me SetFocus any other object on the form. I've tried a few different objects. I was able to just by-pass this and make the button transparent. Since I'm the only one that uses the form I'm the only one that needs to know the button is there.

rodmc = As I was teaching myself how to work with Access, I created this form to help me filter our specific rolls of fabric that need to be returned, based on their RA#. It does what I want it to do. I've tried doing the same in a Report, but it didn't give me as much flexibility. I've been learning as I go, and apparently it seems the hard way. :)
 

Users who are viewing this thread

Top Bottom