View Full Version : Check a box based on input from multiple combo boxes


guardian262
12-26-2008, 09:27 AM
Greetings,
I am working with a self created database for tracking equipment for which a driver's license is issued. For one of my reports, I want a check box to be checked if that person has a license for that piece of equipment. The problem is, that piece of equipment may fall in one of 7 combo boxes in the form. For example:

Record #1 has Light Vehicle entered in VEHICLE 1 combo box. I want the LIGHT VEH check box to be checked.

If Light Vehicle was entered in VEHICLE 2 combo box instead of the VEHICLE 1 combo box (ect down to VEHICLE 7 combo box) I still want the LIGHT VEH check box to be checked. The same type of vehicle would never be entered into 2 combo boxes in a single record.

Thanks in advance for any help,
Guard

Uncle Gizmo
12-26-2008, 02:41 PM
Putting all the vehicles into one table should simplify your problem.

guardian262
12-26-2008, 03:47 PM
Tony,
VEHICLE 1 thru VEHICLE 7 are in the same table, however they need to be in seperate columns for the purpose of printing the government driver's license through the report menu.

The reason i need the expression to check each of the 7 VEHICLE fields is because not all personnel qualify in the same vehicle types. Hence when we have operator A who qualifies on all 7 vehicles, how his vehicles are entered in the combo boxes follows a sort of pattern, however Operator B might only qualify in 2 vehicle types and vehicle 2 has to be on the 2nd line of the license even though it would normally be in the #7 box for someone who qualifies on all 7 vehicle types.

This is what I tried in the code builder for LIGHT VEH checkbox.

If [VEHICLE 1] = "LIGHT VEH THRU" Then
[LIGHT VEH] = YES
ElseIf [VEHICLE 2] = "LIGHT VEH THRU" Then
[LIGHT VEH] = YES
ElseIf [VEHICLE 3] = "LIGHT VEH THRU" Then
[LIGHT VEH] = YES
ElseIf [VEHICLE 4] = "LIGHT VEH THRU" Then
[LIGHT VEH] = YES
ElseIf [VEHICLE 5] = "LIGHT VEH THRU" Then
[LIGHT VEH] = YES
ElseIf [VEHICLE 6] = "LIGHT VEH THRU" Then
[LIGHT VEH] = YES
ElseIf [VEHICLE 7] = "LIGHT VEH THRU" Then
[LIGHT VEH] = YES
End If

My extent of knowledge in code goes back to Java Script and that was a few years ago. The more I think about this, I may have put the question in the wrong forum. Perhaps it fits more with VBA?

Guard

Uncle Gizmo
12-27-2008, 06:34 AM
>>>however they need to be in seperate columns<<<

Sorry my mistake, when I said "table" I meant field. Having the vehicles in separate fields is the crux of your problem.