Open form with search dialog

  • Thread starter Thread starter Sammy
  • Start date Start date
S

Sammy

What's the command to open a form with the search dialog
box automatically opened? I am using the following
command on another form, which works there but not on the
current form I'm trying to modify:

DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Is there a different approach I can take?

Also, Where can I go for a list of the commands
corresponding to numbers in a command such as this? (see
10, above)

Thanks,
Sammy
 
Try:
RunCommand acCmdFind

In general RunCommand has replaced DoMenuItem. There are some 500 odd
constants for RunCommand, and they are not well documented. Terry Wickenden
has the best list at:
http://www.tkwickenden.clara.net/

The idea with DoMenuItem was that you could count the numbers down the menu
(starting with zero as the top item), and use the numbers. However, the
items on the menus do change between versions, so unless you are running
Access 95 (version 7), that may not be much help.

Unfortunately, the wizards still use DoMenuItem. You can understand
Microsoft's reticence to update them (could make them operate differently in
different versions), but they are really poor coding examples.
 
Works! Thank you for clearing up the DoMenuItem
command. No wonder my counting didn't work! I will try
to avoid it in the future, and use a RunCommand instead.
 
Back
Top