command buttons

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that has 3 command buttons on it. I have a print record
command button that I'm having a problem with. I need to print just one
record and it prints all of them. Is there a way I can just print one record
and how would I do that? Thanks in advance.
 
Mary

Take a look at the code behind the <Print> command button. Take a look at
Access HELP on the OpenReport command -- the syntax includes a way to open
the report and limit/filter it to only a single record from the table. One
of the examples should show how this is done.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I'm sorry but I still can't figure this out. If there is anything else that
may help me I would greatly appreciate it. I'm very new to access I'm sorry.
Thanks again.
 
Mary

Open the form in design mode. Highlight the <Print> command button,
right-click it, and select the OnClick event. Click on the "..." (builder)
button to the far right of the [Event Procedure] that follows OnClick in the
Properties window.

The VBA code window will open, displaying the code that runs when you click
the button. Select HELP, and search for OpenReport. Access HELP will
display the syntax you need to use.

Modify the code to match the syntax.

Close the VBA window, save the form's design changes, and try again.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thank you very much! It works great! Thanks again.

Jeff Boyce said:
Mary

Open the form in design mode. Highlight the <Print> command button,
right-click it, and select the OnClick event. Click on the "..." (builder)
button to the far right of the [Event Procedure] that follows OnClick in the
Properties window.

The VBA code window will open, displaying the code that runs when you click
the button. Select HELP, and search for OpenReport. Access HELP will
display the syntax you need to use.

Modify the code to match the syntax.

Close the VBA window, save the form's design changes, and try again.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Mary said:
I'm sorry but I still can't figure this out. If there is anything else
that
may help me I would greatly appreciate it. I'm very new to access I'm
sorry.
Thanks again.
 
Back
Top