My UNDO wont UNDO
I have a CANCEL button which locks certain controls and does a few other things. I also wanting to cancel any changes a user makes to a unlocked record. Mu problem is the UNDO method in VBA doesn't undo. Am I doing something wrong?
Private Sub btnCancel_Click()
' This is were I am attempting to undo a possible chanhe to a field
Me.Staff_Forenametxtbox.SetFocus
Me.Staff_Forenametxtbox.Undo
Me.Staff_Surnametxtbox.SetFocus
Me.nextBtn.Enabled = True ' Enable next rec button
Me.nextBtn.SetFocus
Me.Staff_Forenametxtbox.Locked = True ' Locked staff forname text box
Me.Staff_Surnametxtbox.Locked = True ' Locked staff surname text box
Me.Staff_Servicetxtbox.Locked = True ' Locked service text box
Me.StaffCheckBox.Locked = True ' Locked Staff checkbox
Me.VolunteerChexkbox.Locked = True ' Locked Volunteer checkbox
Me.ACTIVITIES_SUBFORM_FORALL.Locked = True ' Locked users from making amendments to Activity records
Me.btnSaveRec.Enabled = False ' Disable save button
Me.btnDelete.Enabled = False ' Disable delete button
Me.btnAdd.Enabled = True ' Enable add button
Me.PreRecbtn.Enabled = True ' Enable previous button
Me.Combo89.Enabled = True ' Enable dropdown surname search
Me.status_bar.Caption = "CURRENT RECORD LOCKED" ' Change record status text
Me.unlockBtn.Enabled = True ' Enable unlock button
Me.btnExtraJobsControl.Enabled = True
Me.btnCancel.Enabled = False ' Disable cancel button
DoCmd.GoToRecord , , acFirst ' Return to first record in database
End Sub
Gaz
__________________
Gaz
|