And if they are editing a record, do you want the "Add" button visible? Most
people wouldn't. This code sets the "Save" button to Visible when the "Add"
or "Edit" buttons are clicked, hides "Add" and "Edit," then sets "Add" and
"Edit" to Visible when "Save" is pressed.
Private Sub Form_Current()
AnyTextBox.SetFocus
cmdAdd.Visible = True
cmdEdit.Visible = True
cmdSave.Visible = False
End Sub
Private Sub cmdAdd_Click()
AnyTextBox.SetFocus
cmdAdd.Visible = False
cmdEdit.Visible = False
cmdSave.Visible = True
End Sub
Private Sub cmdEdit_Click()
AnyTextBox.SetFocus
cmdAdd.Visible = False
cmdEdit.Visible = False
cmdSave.Visible = True
End Sub
Private Sub cmdSave_Click()
AnyTextBox.SetFocus
cmdAdd.Visible = True
cmdEdit.Visible = True
cmdSave.Visible = False
End Sub
You might also consider having a "Cancel Add/Edit" button so that your users
can dump a new record or edits to a given record, if they change their minds.