Private Sub butFind_Click()
On Error GoTo ER
Screen.PreviousControl.SetFocus
Me.AllowEdits = False 'Suppress REPLACE tab
DoCmd.RunCommand acCmdFind
Me.AllowEdits = True 'Restore state
Exit Sub
ER:
Me.AllowEdits = True
MsgBox Err.Description
End Sub
Check that any edits are saved before you do this, e.g. add the line:
If Me.Dirty Then Me.Dirty = False
immediately before you turn off AllowEdits.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.