Buttons visibile

E

Emergency Power

I have add, save and an edit buttons on on a form. I want my users to know if
they are in edit mode by hiding it after they click on edit or hiding the
save button when they are not in edit mode.
How do you recommend i accomplish this?
 
L

Linq Adams via AccessMonster.com

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