PDA

View Full Version : search macro



eran3185
06-23-2007, 03:45 AM
hey
i have a main form ( there is link to my forms and my reports).
in one of my forms , i have a id field.
i want to do a macro or something like these that will do this things :
1-go to the form
2-go to the id field
3-push ctrl+f (search in a specific field - the id field)

how can i do this ?

geekgirlau
06-24-2007, 08:51 PM
Actually there is a standard search button - if you use the command button wizard to create a new button for "Find Record", you will see that it creates the following code:


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70


All you need to do is set the focus to the ID field control (rather than the previous control) before bring up the Search dialog.