hi,
on my form there are 2 combos (ms access)
combo1 contains values: 1, 2, 3, 4, 5
combo2 contains values: a, b, c, d, e
if you choose 1 or 2 or 3 from combo1 and a or b from combo 2 it should make label1 visible
if you choose 4 or 5 from combo1 and a, b, c, from combo2 it should make label1 visible & label2 visible
if 4 or 5 & d or e make label2.visible = true
else
label2.visible = false
label1.visible = false
any idea how to make this working? (my problem is writing of the conditions
I would probably create a table with 3 fields:
Combination TEXT (being 1a, 1b, 1c, etc)
Label1 Boolean (YesNo field holding True or False)
Label2 Boolean (YesNo field holding True or False)
Now you can put all combinations in the table and use the value for label1 and label2 to set the correct value, like:
Me.label1.visible = NZ(Dlookup("label1","tblLabels","Combination='" & me.combo1 & me.combo2 & "'"),False)
Me.label2.visible = NZ(Dlookup("label1","tblLabels","Combination='" & me.combo1 & me.combo2 & "'"),False)
The Dlookup will return nothing when a combination isn't found and the NZ() function will set then the default value to False. This way combinations not needing a label1 and/or label2 don't have to be defined in the table.
Idea ?
Nic;o)