Combo box selection activates text box

Grainne

New member
Local time
Today, 14:45
Joined
May 8, 2003
Messages
6
I've searched the forum for this but can only find answers to "Auto updating text boxes on combo box selection"

I want users to be able to make a combo box selection on a form and depending on the option they choose they are then able to enter information into a text box which is stored in a table

Could someone point me in the right direction because I don't know whether I should be creating the text box in my main form or subform or via a query and I don't know what code to write for it to understand that I've made this selection and want the text box to only be activated/visible for this choice.

Many thanks for any help offered and I'm relatively new to Access so please be gentle!!!

Grainne
 
If you only want that textbox to be enabled after making a certain selection from the combo box, then you will need to have some VBA code in the After Update event of the combo box to enable the text box. If you wish to store the results of the text box entry, then the text box should be a "bound" field (meaning that the controlsource is a field in your form's underlying table or query).

Look in the Access online help for more info about writing basic VBA code, attaching code to events and about enabling/disabling form controls....and write back here if you need more help.
 
Thanks dcx693

Yeeehhhh, got it working from your advice

I was thinking it was more complicated than it actually was - usually happens when you don't know what you're doing!!

For anyone else that might be stuck on the same subject, this is what I used:

Private Sub EnquirySourceID_AfterUpdate()
Form_Current
End Sub

Private Sub Form_Current()
Me.EnquirySourceID.SetFocus
Me.EnquirySourceComment.Enabled = (Me.EnquirySourceID.Text = "Other (please state)")
End Sub

Now the comment text box only enables when I select "Other (please state)" from my combo box


Grainne :D
 

Users who are viewing this thread

Back
Top Bottom