|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Checkbox and Click eventWhat would cause a checkbox on a form to produce a Click event, by
setting/changing its value through code? Just for display purposes I'm using: '** Refresh form ** If RSr!Page = 0 Then chkPage.Value = 0 Else: chkPage.Value = 1 End If Occurs when the underlying value changes from 0 to 1, or 1 to 0, when stepping through records, or just opening the form. Does the Click event not really mean "Mouse click" but value change? "Edward" <nospam@mail.com> wrote in message You answered your own question. The Click event fires when the value news:JuDrl.21383$Tp5.12322@newsfe13.iad... > What would cause a checkbox on a form to produce a Click event, by > setting/changing its value through code? changes. If you want to ignore events triggered from code you have to code for it. One method: Private mbFromCode As Boolean Private Sub chkPage_Click() If not mbFromCode Then ' handle user click end if End Sub .... '** Refresh form ** mbFromCode=True If RSr.Fields("Page").Value = 0 Then chkPage.Value = vbUnchecked Else chkPage.Value = vbChecked End If mbFromCode=False
Show quote
Hide quote
"Bob Butler" <noway@nospam.ever> wrote in message Worked like a charm.news:OQxTDvRnJHA.1288@TK2MSFTNGP02.phx.gbl... > > "Edward" <nospam@mail.com> wrote in message > news:JuDrl.21383$Tp5.12322@newsfe13.iad... >> What would cause a checkbox on a form to produce a Click event, by >> setting/changing its value through code? > > You answered your own question. The Click event fires when the value > changes. If you want to ignore events triggered from code you have to > code for it. One method: > > Private mbFromCode As Boolean > > Private Sub chkPage_Click() > If not mbFromCode Then > ' handle user click > end if > End Sub > > ... > '** Refresh form ** > mbFromCode=True > If RSr.Fields("Page").Value = 0 Then > chkPage.Value = vbUnchecked > Else > chkPage.Value = vbChecked > End If > mbFromCode=False > Thanks for your time. "Edward" <nospam@mail.com> wrote in message For a checkbox, that's absolutely correct.news:JuDrl.21383$Tp5.12322@newsfe13.iad... > What would cause a checkbox on a form to produce a Click event, by > setting/changing its value through code? > Does the Click event not really mean "Mouse click" but value change?
The Myth of Visual Basic Migration / Upgrade
Please help to translate this short Delphi code close excel from VB6 How difficult is to add my menu to Windows Explorer? Error Message Help Write in C Unbelieveable code, it produces one result in VB6 run and another if compiled in a exe file ???? Wha global On Error Goto ? How to add new rows to Listview Get My Pictures Back |
|||||||||||||||||||||||