Sure, here is what you do:
Assuming you have the following code in your form to print the current
record:
me.refresh ' must write data to disk (report reads from table)
docmd.OpenReprot "MyReprot",acViewPreview,,"id = " & me!ID
The above code is likely what you used (you can remove the acViewPreview if
you want the report to print, and not preview).
So, take the above code in the form, and move it to a function in the form
like:
Public Function MyInvoicePrint()
me.refresh ' must write data to disk (report reads from table)
docmd.OpenReprot "MyReprot",acViewPreview,,"id = " & me!ID
end Function.
You can have the button code on the form (if you keep the button) go:
MyInvoicePrint
Now, build your custom tool bar, add a custom button, right click to get to
properties, and in the button on-action, simply put
=MyInvoicePrint()
You are done. So, you can quite easily have the menu bar, or tool bar call
code in the form.