Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Undo Togglebutton click 2

Status
Not open for further replies.

wvandenberg

Technical User
Oct 24, 2002
125
CA
Hi all,

I have a toggle button and have implemented the following code in the BeforeUpdate event:

Code:
Private Sub tglDate_BeforeUpdate(Cancel As Integer)
    If Not ApplyCriteria Then
        Me.tglDate.Undo
        Cancel = True
    End If
End Sub

The problem is that the togglebutton stays depressed even with the .Undo line of code. Can anyone see any problems with my code? Any suggestions to get the toggle to be set back to False?

Thanks in advance,
Wendy
 
Try set the value back to 0. I would probably use the AfterUpdate event
Code:
Private Sub tglDate_AfterUpdate(Cancel As Integer)
    If Not ApplyCriteria Then
        Me.tglDate = 0
    End If
End Sub


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top