Solved MS Access print form instead of report

Akai90

Member
Local time
Today, 15:34
Joined
Feb 8, 2022
Messages
67
hai

i have problem sometime my print preview report will print form not a report. print preview show report but it will print forms not report (sometime will print report but sometime will print forms)..
can i know what the problem ? any wrong setting ?

report call via button from forms
button using marco setting

print report.png
 
Remove the macro and do it with VBA. It only takes one command:

DoCmd.OpenReport "xxx".......

Access will help you with intellisense to complete the string.
 
Remove the macro and do it with VBA. It only takes one command:

DoCmd.OpenReport "xxx".......

Access will help you with intellisense to complete the string.
TQ for the reply.
 
Remove the macro and do it with VBA. It only takes one command:

DoCmd.OpenReport "xxx".......

Access will help you with intellisense to complete the string.
already try this code but.. it will direct print the report.
i want open the print preview first to check all data is correct.
 
you are "missing" additional parameter:

docmd.OpenReport "report_name", acViewPreview
 
already try this code but.. it will direct print the report.
You might want to examine ALL the arguments of a command before saying they don't work.
print preview show report but it will print forms not report (sometime will print report but sometime will print forms)..
This won't happen with the VBA command because it is specific about what it is opening, but if you use the same name for two objects (form and report), you get what you asked for - confusion.

Access only forces uniqueness between tables and queries and that is because in most cases tables and queries can be used interchangeably. Having duplicate names would prevent that.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom