Calculation based on tick box

Krays23

Registered User.
Local time
Today, 07:38
Joined
Jun 18, 2015
Messages
46
Hi

can you guys help me?

See photo attached what I need to do is in the box delta ODD is look up that row of check boxes if it finds a check box then calculate the difference between those two dates.

PLease help im stuck

Dan
 

Attachments

  • sheet.png
    sheet.png
    54.6 KB · Views: 92
create a code on your checkbox click event:

private sub checkbox_click()
if checkbox then
if Trim(me.textboxDate1 & "") <> "" And Trim(me.textboxDate2) <> "" then
me.textboxToShowDiff = DateDiff("d", me.textboxDate1, me.textBoxDate2)
end if
else
me.textboxToShowDiff = ""
end if
end sub

***
template code. supply correct textboxes, checkbox name to the code.
 
Thanks Arnel

Is there any way I can get my data base to you so you can have a look at a few things im trying to do ? ive been strruugling for days now and its costing me sleep!!!

Regards

Dan
 
create a code on your checkbox click event:

private sub checkbox_click()
if checkbox then
if Trim(me.textboxDate1 & "") <> "" And Trim(me.textboxDate2) <> "" then
me.textboxToShowDiff = DateDiff("d", me.textboxDate1, me.textBoxDate2)
end if
else
me.textboxToShowDiff = ""
end if
end sub

***
template code. supply correct textboxes, checkbox name to the code.

Hi how do you make it go blank if you remove the tick mark ?
 
it will go blank when you untick it (see the Else clause).
 
Why not add a calculated field to each row and display the result if there is data and not if there isn't ?
 

Users who are viewing this thread

Back
Top Bottom