Hi,
You can do so by entering your code after On Error GoTo Err_FindCompany_Click.
http://www.sourcecodester.com - Download free source code
"yassoon" <yassoon[ at ]discussions.microsoft.com> wrote in message news:C39EB2E1-3646-4116-8F18-A9A329C8B0B0[ at ]microsoft.com...
[Quoted Text] > I'd like to add a command buttons so that each one is dedicated to Find in > a > specific data field, eg a button to search for last name, another to > search > for company name. And so there'd be a macros for each button. How do I > modify the script so that it goes to a specific field? Below is the > default > script. If someone could tell me what and where I need to add to the > script, > that would be great. Thanks > > MsgBox Err.Description > Resume Exit_FindName_Click > > End Sub > Private Sub FindCompany_Click() > On Error GoTo Err_FindCompany_Click > > > Screen.PreviousControl.SetFocus > DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 > > Exit_FindCompany_Click: > Exit Sub > > Err_FindCompany_Click: > MsgBox Err.Description > Resume Exit_FindCompany_Click > > End Sub
|