Solved Report Checkbox On Click Fires Twice (1 Viewer)

Isaac

Lifelong Learner
Local time
Yesterday, 16:52
Joined
Mar 14, 2017
Messages
8,777
I've never heard of anyone trying to draw pretty much any controls on a report, much less a checkbox, but thanks - I learned today that a checkbox on a report has no AfterUpdate event.

You may have to declare a global variable and keep track of when it's fired the first time to disable the second one, may have to get a bit creative on this one.

alone inside modGlobals, maybe with other globals:
global lngCheckboxEvent as long

report open - set to 0

checkbox click event -
if lngCheckboxEvent=2 then
lngCheckboxEvent = 3
'do something
else
'do nothing, except:
lngCheckboxEvent = lngCheckEvent + 1
end if



Admittedly, I'm not proud of the code I just wrote. :) And I'm not sure I thought it through 100% well enough to be fool proof.
But it may give you some helpful ideas you can build on.

Somehow, someway, you get a counter going and increment it so that it only fires approximately once per click. :p
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 00:52
Joined
Sep 21, 2011
Messages
14,260
I've never heard of anyone trying to draw pretty much any controls on a report, much less a checkbox, but thanks - I learned today that a checkbox on a report has no AfterUpdate event.
I have put a button on a report in the past, just to be able to print it easily, but that is it?
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:52
Joined
Mar 14, 2017
Messages
8,777
I have put a button on a report in the past, just to be able to print it easily, but that is it?
Yeah I was thinking back, I've maybe slapped a button on a report on rare occasions for some reason, but close to nothing.
 

Users who are viewing this thread

Top Bottom