toggle button click event not firing

  • Thread starter Thread starter Jayyde
  • Start date Start date
J

Jayyde

OK, next random problem...

Have a toggle button that I've put on most of my forms, wrote the code for
it in a Click() event. Checked the properties of the control itself to make
sure the event is there and the name is correct. Tested it, clicked on it,
nothing happened. Ran the debugger w/ a breakpoint on its click event,
never entered it--on any of the forms. Am I missing something or did Access
finally scream in pain and die on me?
 
What does the button toggle between?

Is it just one button?

Is the code for the button itself or the frame?

Please supply code.
 
Sorry for the lack of info...

The button is one button, but on most of the forms. It's a toggle to turn
editting on/off.

Code:

Private Sub tglEdit_Click()

Call SetEdit(tglEdit.Value)

End Sub


Private Sub SetEdit(b As Boolean)

If (b) Then
Me.AllowEdits = True
tglEdit.Caption = "Turn Editting Off"
Else
Me.AllowEdits = False
tglEdit.Caption = "Turn Editting On"
End If

End Sub

I have the seperate sub because I have to turn edits off at random other
times (like after someone's done adding a new record).
 
Ok, tried doing this as a checkbox and the same thing is happening. It
never moves from the AllowEdits & control.Value = false. The only other
thing I can think of is that either the form's .AfterInsert or .Current are
getting fired when the focus changes from one of the textboxes/combo boxes
on the form to the edit toggle or checkbox...
 
Because I wanted something that looked to the user like it was on/off. I
wanted them to have a visual cue.

No worries though, I got it working. But thanks for the help =).
 
Back
Top