Search button on form

Daveyk0

New member
Local time
Today, 14:16
Joined
Oct 26, 2004
Messages
6
Hello there,

I maintain, and update, a Access database that was started many years ago. On some of the forms, there are search buttons that allow a user to find a given record for a certain field, such as SerialNumber.

The method works well but seems to me to be done in an rather archaic manor that I can find little help on understanding what it is doing:

=================
Private Sub Find_Click()
'
Me.SerialNum.SetFocus
'
DoCmd.DoMenuItem A_FORMBAR, A_EDITMENU, 10, , acMenuVer70
'
End Sub
=================

Is there a better or more understandable way of doing this? I would assume the "10" is the tenth option on that edit menu menu? We now use Access 2000 and "Find" is the 12th option option on that menu. I don't know what version70 menus looked like and there isn't really any on-line help for that.

Is there a more universal method for calling the find record command?

Thanks kindly,

Dave
 
Dave,

The best way to run the find record command is:

DoCmd.RunCommand acCmdFind

Use this instead of the "DoCmd.DoMenuItem..." line.

Cheers,

Rusty
:D
 
;)

Thank you kindly. I am trying to learn all the build-in commands that must not have existed when this database was first developed years ago.

There are areas that I am still confused. Most of Access 2000 is pretty easy, but I can see some of the help is a little lean.

Dave
 

Users who are viewing this thread

Back
Top Bottom