A 2010 if than...label

Dick7Access

Dick S
Local time
Today, 07:12
Joined
Jun 9, 2009
Messages
4,336
Hi All,
I have a db I made for my wife to track Glycemic Index of food. She wanted the high and low show up whenever she checked a check box for low Med and High. Whenever I check a food with Med it will open the labels that show med but then when I go to low or high is stays on med. From high to others that same thing and from low to others the same thing. It will be appreciated if someone can open it and see what it is that I am screwing up. (F9 goes to datasheet view, and F10 to form view.) please find attachment.
 

Attachments

I'm not exactly sure what you are asking for. If I understand correctly, you want the correct labels showing whenever you navigate to the next record e.g. navigating to record 17 should show the Med labels (because the value of MedCheck for that record is true).

Just add this code in the On Current event for the form:

Code:
Call LowCheck_Click
Call MedCheck_Click
Call HighCheck_Click

The On Current event fires each time you arrive at a record. So basically the code I've given simulates the three check box clicks without actually changing them.

Sorry if I've misunderstood the problem.

Chris
 
Stoper, thanks for answering. You understood the questions correctly, and that fixed my problem. I usually like to Google my problems before I come to the forum, but in this case I did not even know what to Google. Even tho I have been using access for quite a while I have not used VBA much, and just getting into it lately, so I am a newbie as far as VBA is concerned. I thought that “Call” could only be used to call a function. Even tho it works with your added code, I am still not clear as to why. Please correct me if I am wrong. The three calls on the current event are firing the appropriate click events for each record. Am I correct?
Dick S.
 
The three calls on the current event are firing the appropriate click events for each record. Am I correct?
Dick S.
Pretty much. But strictly speaking the events are not firing at all in the code I gave you. All I did was run the same subroutines that the events would have called.

Maybe this will help.

Chris
 

Users who are viewing this thread

Back
Top Bottom