hi,
am working on building a form in MS ACCDESS:
I have there some combos & some textboxes.
I want to create a macro about behaviour of 3 of those:
textbox1, textbox2 & textbox3 should be active if value from combobox = answer1
if it is so, I need also to make these 3 textboxes mandatory
if the value of the combobox is different, those textboxes should be dissabled
please help.. am lost
if you're using a single form view this will be straightforward; I prefer select case rather than if then else procedures;
select case me![mycomboboxname]
case 1
me.[textbox1].enabled = true
me.[textbox2].enabled = true
me.[textbox3].enabled = true
case 2
me.[textbox1].enabled = false
me.[textbox2].enabled = false
me.[textbox3].enabled = false
case 3
me.[textbox1].enabled = true
me.[textbox2].enabled = true
me.[textbox3].enabled = true
case else
me.[textbox1].enabled = false
me.[textbox2].enabled = false
me.[textbox3].enabled = false
end select
If you're using a continuous form, welcome to a world of pain in this respect, as you can't have different enabled properties for each instance of the form, just some limited conditonal formats. The best trick seems to be to use a text box to hide the control in this situation, by changing it's colours according to the condition of a field.