MS Access Adding a Filtering ToolBar to Form

1k Views Asked by At

I have Microsoft Access Form where I have table of data I want to be able to add a filtering toolbar to the form in MBE mode. Note MBE not in the designer mode of MDB. I.e. I want a filter on the distributed MBE file.

In Form.Open event I added:

Private Sub Form_Open(Cancel As Integer)
  DoCmd.ShowToolbar "Ribbon", acToolbarYes
  DoCmd.ShowToolbar "ribbonMain", acToolbarYes
  DoCmd.ShowToolbar "Menu Bar", acToolbarYes

End Sub

I also tried

Private Sub Ctl__Click()
  Dim db As DAO.Database
  Dim prop As DAO.Property
  Set db = CurrentDb()
  DoCmd.ShowToolbar "Ribbon", acToolbarYes
End Sub

Also, Access Button - > Access Opiton ->Current Database Under the Ribbon and Toolbar Options: Checked Allowed Built-in Toolbars. Also, Ribbon Name is "ribbonMain".

I still cannot see the Toolbar in the top of Form. What am I missing in the code or access page set up. I am running on MS Access 2003. I would really like to have same filtering you see in design mode of a table in an deployed MBE file.

1

There are 1 best solutions below

0
On

I would suggest putting the code in the On load even instead also DoCmd.ShowToolbar "Ribbon", acToolbarYes may cause error in access 2003. When i was building my database i found this post helpful. http://www.access-programmers.co.uk/forums/showthread.php?t=97578