Ticked checkboxes on subform

D

DubboPete

Hi all,

I have three checkboxes on a subform, S5, S10 and S15, indicating
whether a vehicle has had a service at 5k, 10k and 15k intervals. I
want to loop through these to test if a service has been completed
already, depending on the kilometers entered on the main form
[endodo].

So if a vehicle has a speedo reading of 16400 kms, and subform's S5 is
ticked, S10 is ticked, yet S15 isn't, then I get a msgbox to alert me
that a service is due.

Can someone help with the clues to the code I should use please?

tia

DubboPete
 
O

OldPro

Hi all,

I have three checkboxes on a subform, S5, S10 and S15, indicating
whether a vehicle has had a service at 5k, 10k and 15k intervals. I
want to loop through these to test if a service has been completed
already, depending on the kilometers entered on the main form
[endodo].

So if a vehicle has a speedo reading of 16400 kms, and subform's S5 is
ticked, S10 is ticked, yet S15 isn't, then I get a msgbox to alert me
that a service is due.

Can someone help with the clues to the code I should use please?

tia

DubboPete

' There is no need for looping... just put this in the AfterUpdate
event of the control that selects the customer.

If not S5 and speedo>5000 then
msgbox "Service Needed"
elseif not S10 and speedo>10000 then
msgbox "Service Needed"
elseif not S15 and speedo>15000 then
msgbox "Service Needed"
endif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top