How get rid of 'Replace' tab in 'Find & Replace' window

M

mscertified

This seems to work ok:

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
 
A

Allen Browne

That's not a bad workaround.

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.
 
Top