Need pop-up form/report to populate based on current record

G

Guest

I'm trying to create a pop-up form or report that will populate with a few
fields from an existing form. Ideally, I'd like to open the existing form,
type in data for a new record, then hit a button that will open the pop-up
form that contains data I just entered. The pop-up document is a checklist
that will be printed out and written on manually, but I want to avoid having
to write down the pertinent existing information that I just input.

I'm using Access 2003, and the Help utility isn't helping. Any assistance
would be much appreciated.
 
G

Guest

Hi

I wouldn't use a popup form if you want to print it. Use a report

Create a button on your form with something like this on the OnClick event
(this will preview the report. Note I have used acDialog you can change this
if you prefe to acNormal


Private Sub PreviewButton_Click()
DoCmd.OpenReport "ReportName", acViewPreview, "",
"[FieldInTheReport]=[Forms]![FormName]![ControlOnTheForm]", acDialog
End Sub


Use acViewNormal instead of acViewPreview in the above code to print the
report. So it will look something like this

Private Sub PrintButton_Click()
DoCmd.OpenReport "ReportName", acViewNormal, "",
"[FieldInTheReport]=[Forms]![FormName]![ControlOnTheForm]", acNormal
End Sub


Hope this helps
 
G

Guest

Thanks, Wayne. If I have multiple form controls to populate into the report,
do I just separate the different expressions with commas?

Wayne-I-M said:
Hi

I wouldn't use a popup form if you want to print it. Use a report

Create a button on your form with something like this on the OnClick event
(this will preview the report. Note I have used acDialog you can change this
if you prefe to acNormal


Private Sub PreviewButton_Click()
DoCmd.OpenReport "ReportName", acViewPreview, "",
"[FieldInTheReport]=[Forms]![FormName]![ControlOnTheForm]", acDialog
End Sub


Use acViewNormal instead of acViewPreview in the above code to print the
report. So it will look something like this

Private Sub PrintButton_Click()
DoCmd.OpenReport "ReportName", acViewNormal, "",
"[FieldInTheReport]=[Forms]![FormName]![ControlOnTheForm]", acNormal
End Sub


Hope this helps

--
Wayne
Manchester, England.



Rudolphia said:
I'm trying to create a pop-up form or report that will populate with a few
fields from an existing form. Ideally, I'd like to open the existing form,
type in data for a new record, then hit a button that will open the pop-up
form that contains data I just entered. The pop-up document is a checklist
that will be printed out and written on manually, but I want to avoid having
to write down the pertinent existing information that I just input.

I'm using Access 2003, and the Help utility isn't helping. Any assistance
would be much appreciated.
 
G

Guest

Hi

You can use multiple criteria but it may start to get a bit much.. There is
a common technique used (qbf) that will filter a query (that you report is
based on) useing the data you select on a form.

Have a look at the main MS website for the method to use "query by form".
It looks a bit difficult at first but once you get started you will find it's
really very simple.

Try this link to start with

http://support.microsoft.com/kb/304428/en-us

good luck

--
Wayne
Manchester, England.



Rudolphia said:
Thanks, Wayne. If I have multiple form controls to populate into the report,
do I just separate the different expressions with commas?

Wayne-I-M said:
Hi

I wouldn't use a popup form if you want to print it. Use a report

Create a button on your form with something like this on the OnClick event
(this will preview the report. Note I have used acDialog you can change this
if you prefe to acNormal


Private Sub PreviewButton_Click()
DoCmd.OpenReport "ReportName", acViewPreview, "",
"[FieldInTheReport]=[Forms]![FormName]![ControlOnTheForm]", acDialog
End Sub


Use acViewNormal instead of acViewPreview in the above code to print the
report. So it will look something like this

Private Sub PrintButton_Click()
DoCmd.OpenReport "ReportName", acViewNormal, "",
"[FieldInTheReport]=[Forms]![FormName]![ControlOnTheForm]", acNormal
End Sub


Hope this helps

--
Wayne
Manchester, England.



Rudolphia said:
I'm trying to create a pop-up form or report that will populate with a few
fields from an existing form. Ideally, I'd like to open the existing form,
type in data for a new record, then hit a button that will open the pop-up
form that contains data I just entered. The pop-up document is a checklist
that will be printed out and written on manually, but I want to avoid having
to write down the pertinent existing information that I just input.

I'm using Access 2003, and the Help utility isn't helping. Any assistance
would be much appreciated.
 
L

Larry Linson

Rudolphia said:
Thanks, Wayne. If I have multiple form
controls to populate into the report,
do I just separate the different expressions
with commas?

Reports are not populated from Form Controls -- they are populated from data
stored in Tables, accessed directly, or accessed via a Query that you use as
the RecordSource of the Report.

If you have just entered a brand-new Record, you will have to ensure that it
has been saved before trying to view it in a Report. In bound Forms, the
Record is saved when you move off that Record to a different one, when you
close the Form, or when you move the cursor into a Subform Control on the
Form; or by VBA code, setting the Dirty property of the Form to False, or by
the DoCmd.RunCommand statement with acSaveRecord (make certain that my
memory was accurate on that builtin constant's name) argument specified.

Larry Linson
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top