conditional formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please excuse the duplicate posting, but I need to send this db to my
supervisors this morning (asap!!).

I have this code on the Afterupdate event of a field called Keep, with a
label that shows up when Keep=4.
Me.NameOfYourLabel.Visible = (Me.Keep = 4)

Turns out that I now need to have this label toggle visible when KEEP = 2,3,
or 4. (possible values are 1-4)

What should this code look like? I tried putting in (...Me.Keep = 2 Or 3 Or 4)
but the label just seemed to stay on no matter what was clicked.

Thanks for your help!
Christine
 
I'm not an expert Access database user... but since you are in a hurry
I thought I'd drop an idea your way. Try using a dlookup. It'll look
for a value in a list and return that value when it finds the first
record that meets your criteria. Then you can take the result and
apply it to an IF statement that will make the field visible. If it
doesn't find a result, it returns a null - so it's good to apply the
NOT ISNULL function to the script and then apply the true or false
result to your IF statement.

Hope this helps.

OR

I just had another thought... There is a sql term called IN

SELECT keep FROM table
WHERE keep IN (2, 3, 4);

This is sql script and I can see you are in MVB but it might give you a
lead.
 
Please excuse the duplicate posting, but I need to send this db to my
supervisors this morning (asap!!).

I have this code on the Afterupdate event of a field called Keep, with a
label that shows up when Keep=4.
Me.NameOfYourLabel.Visible = (Me.Keep = 4)

Turns out that I now need to have this label toggle visible when KEEP = 2,3,
or 4. (possible values are 1-4)

What should this code look like? I tried putting in (...Me.Keep = 2 Or 3 Or 4)
but the label just seemed to stay on no matter what was clicked.

Thanks for your help!
Christine

Me.NameOfYourLabel.Visible = Me![Keep] >1
 
Thanks for the ideas! Unfortunately I'm pretty new to coding and anything
advanced in Access so I would need more time than I have to figure them out.

But thank you!
 
Worked perfectly. Thank you!

fredg said:
Please excuse the duplicate posting, but I need to send this db to my
supervisors this morning (asap!!).

I have this code on the Afterupdate event of a field called Keep, with a
label that shows up when Keep=4.
Me.NameOfYourLabel.Visible = (Me.Keep = 4)

Turns out that I now need to have this label toggle visible when KEEP = 2,3,
or 4. (possible values are 1-4)

What should this code look like? I tried putting in (...Me.Keep = 2 Or 3 Or 4)
but the label just seemed to stay on no matter what was clicked.

Thanks for your help!
Christine

Me.NameOfYourLabel.Visible = Me![Keep] >1
 
Back
Top