A bit Confused

crann

Registered User.
Local time
Today, 12:45
Joined
Nov 23, 2002
Messages
160
Hi Guys,

Getting a bit confused with code.

I am trying to print a report from a form, i want the button to print a report based on the information in that current form, if i insert just a normal print report button it prints all reports in the database.

Do i need to save the form before i can print it as a report, and how do i get it to just print the report that shows the information thats is in the current open form.

Any Help really needed, i am new to code so simple is good.

Thanks
 
One way of doing it (I´m sure there are other ways) would be to print a query, having

Forms!.[yourformname].[IDfield]

in the criteria for the IDfield.

Fuga.
 
Fuga said:
One way of doing it (I´m sure there are other ways) would be to print a query, having

Forms!.[yourformname].[IDfield]

in the criteria for the IDfield.

Fuga.

Thanks but i really need to be able to press print at the end of filling out the form and then get the report style of that information
 
crann,

Make a new query based on your table.
The query includes all fields that you will need on your report.
Your PrimaryKey field (unique identifier) will have as its
criteria: = Forms![YourForm]![YourField]

Have the wizard make a report based on this query.

On your form, make a command button called "Print".
In its on-click event put:

DoCmd.OpenReport "YourReport", acPreview

hth,
Wayne
 

Users who are viewing this thread

Back
Top Bottom