Combo box event

Bachfile

Registered User.
Local time
Today, 05:35
Joined
Jul 4, 2002
Messages
41
I have a combo box that works just fine that I wanted to add a little
more pazazz to.

What I was hoping to do was have a field that is normally hidden pop up
(or reveal itself rather) if the user selects 'No' - this would allow the user
to record a 'Reason' for the 'No'

I understand I will have to probably add some code in the afterevent area.
Unfortunately I have forgotten everything with respect to coding.

Is this even possible?

Thanks in advance for any help!
 
Yes, it's possible.
In the AfterUpdate event of the combo box in question, you'd add something along the lines of
Code:
If [Forms]![[I]form name[/I]]![[I]name of combo box[/I]] = "No" Then
        [Forms]![[I]form name[/I]]![[I]name of other field[/I]].Visible = True
else
        [Forms]![[I]form name[/I]]![[I]name of other field[/I]].Visible = False
end if
This assumes that you don't want to see the second field if the user doesn't pick 'No'.

If I were you, I'd also add a line making the second field invisible when the form opens or as you go to each new record.

Hope it helps.
 
If I were you, I'd also add a line making the second field invisible when the form opens or as you go to each new record.

Hope it helps.

Just as an FYI to expand upon that statement: That would be putting the same code in the On Current event
 
Yep, that's what I should have said. :o
 
Need more help.. sorry

Thank you both for the advice - I have inputted the code
but it is not working.

Problem 1 - I am using Access 2000 therefore I do not have an 'On Current'
option, or at least I can't find it

Problem 2 - I'm a complete idiot and I can't remember exactly how the syntax works - If I have a database named db1, with the form name CompanyContactList, a combo box named Combo38 with the control field named Status what would those command lines actually look like?

As it stands the textbox that was supposed to be hidden unless the user selects 'No' in status is always there...

Thank you once again for your help however!
 
Problem 1 - I am using Access 2000 therefore I do not have an 'On Current'
option, or at least I can't find it
It's the FORM's On Current event - if you open the form in design mode and don't select a control, then go to the events tab in properties, you will get the selection.
Problem 2 - I'm a complete idiot and I can't remember exactly how the syntax works - If I have a database named db1, with the form name CompanyContactList, a combo box named Combo38 with the control field named Status what would those command lines actually look like?
If someone answers this for you before I can, that's good. I need to leave right away so I might not be able to get to it in a timely manner. Sorry - gotta run.
 

Users who are viewing this thread

Back
Top Bottom