Alex
It sounds like you have a listbox with items, a specific set of 5 of which
would be cause to change your textbox visibility.
What happens when the list of 'trigger' items changes (grows, shrinks, ....)?
Are you going to go back through your code, macros, queries, etc. and be
able to find all the places that need to be changed?
If this is unlikely to happen (a change), your approach is probably
sufficient.
If this is either likely to happen or "could NEVER happen", you might want
to look into an alternate approach, one that uses a table to hold 'trigger'
values. Then you can check to see if what was selected in the listbox is in
the table of triggers...
Good luck!
Regards
Jeff Boyce
Microsoft Office/Access MVP
Where are you trying to do this?
(FWIW, you can't do .value = "example1" or "example2". It would have to be
.value = "example1" or .value = "example2")
Doug,
I'm trying to hide a textbox on a subform based on the value of
listbox on the main form.
I have this code already (and it works fine):
if .value = "example1" then
What I wanted to do was hide the textbox based on 5 values in the list
box. I was hoping that [if .value in ()] would work but it does not.
As you mentioned above, I could do .value = "" or .value = "". But, I
thought there must be a way to just list out the values.
Something like:
if .value = (list of values) then
alex- Hide quoted text -
- Show quoted text -