Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu Version needed to run event procedure

Status
Not open for further replies.

balistikb

Technical User
Nov 12, 2002
177
0
0
US
I have an event procedure that needs to apply a filter usinf a menu item. In my code it is asking for menu version. How can I find out what menu version I have? I am using Access 2000. It seems the menu version that it automatically places in the code is incorrect. Please help. Here is my code...

{DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70}
 
try
Docmd.RunCommand acCmdApplyFilterSort

DoMenuItems are only for backward compatibility
 
I am not sure what that is doing but it doesn seem to sort the way I need. I would like the user to select text from a field and filter in only that selecting.
 
DoCmd.RunCommand acCmdFilterBySelection

The trick is to have focus on selected text before running

example
Code:
Private Sub Command0_Click()
  me.controlname.setfocus
  DoCmd.RunCommand acCmdFilterBySelection
end sub

you can turn of filtering with
DoCmd.RunCommand acCmdRemoveFilterSort

Hopefully this helps
 
That worked but causes another problem. The field that I need to filter by is a combo box. If I am on a record in my form, and I want to change what is in the combo box so I can filter by it, it changes that value of that combo box for that record. How can I filter without chnging what is in my fields?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top