Working with ToolBars

  • Thread starter Thread starter Brent
  • Start date Start date
B

Brent

I have a database that was programmed by a previous employee in our company.
They used custom toolbars to link to reports in the database. Is there a
way I can use filters when opening reports via the toolbar?

Here is an example of how I would normally code a button to open the report
if I did it in VBA.

ex.. docmd.OpenReport ("frmreport1", ,"PermitName ='"& txtpermitname & "'")

Thanks
Brent
 
You can direct the "On Action" property of a toolbar item to run a custom
procedure:

CommandBars("Menu Bar").Controls("Reports").Controls("Current
Permit").OnAction = "PrintCurrentPermit"

Public Sub PrintCurrentPermit()
DoCmd.OpenReport ("frmreport1", ,"PermitName ='"& txtpermitname & "'")
End Sub

Is that what you had in mind?

Not sure a toolbar is the best place for that (as opposed to a button on a
form) unless you know that txtpermitname will always have a value.

HTH,
 
Back
Top