Link to home
Start Free TrialLog in
Avatar of Robert Francis
Robert Francis

asked on

Problem enabling button after record update Access 2007

I have a form that uses the following code when it loads:

Private Sub Form_Current()
Me!btn_cancel_time.Enabled = False
Me!btn_nevermind_time.Enabled = True
End Sub

Open in new window


Then does this when a change is made:

Private Sub Form_Dirty(Cancel As Integer)
Me!btn_cancel_time.Enabled = True
Me!btn_nevermind_time.Visible = False
End Sub

Open in new window


This works great. Problem is I have a button for saving the record and adding another:

Private Sub btn_add_time_Click()
DoCmd.GoToRecord acDataForm, "time_entry", acNewRec
Me.tar_abs.Visible = False
Me.excused.Visible = False
Me.reason.Visible = False
Me.Label44.Visible = False
Me.Label46.Visible = False
Me.Label48.Visible = False
Me!btn_cancel_time.Enabled = False
Me!btn_nevermind_time.Enabled = True
End Sub

Open in new window


All of the .visible code is working but I cant make it enable and disable the buttons back to the way they were when the form loaded the first time.
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial