Changing combo box based on text box value

access_uk

Registered User.
Local time
Today, 19:26
Joined
Mar 12, 2010
Messages
11
Hi all


I would appreciate any guidance on this problem as I have been struggling with this for the past 2 hours.

I have a combo box in a subform that is populated by retrieving records from a table using a SELECT statement. I want to restrict these records based on a value from a text box within the same form.

What I did was to select the combo box and then click Row Source in Properties. I then added a condition to this query to retrieve only those fields where customer id = Forms![Contact Information]![Text1] but it is simply not doing it.


Any ideas on how I can get this to work? I thank you all for your help.


Thanks
 
What you have done should work. However you will need to force the Combo to requery, using something like the following;
Code:
Me.ComboName.Requery
In the form's On Current Event, and also the text box's On Change event.
 
Hi John



Thank you for the quick reply.

I got it to work but I forgot to mention that this is a subform within a tab control.

How do I reference this subform in the On Current Event of the main form?

Do I have to use something like this?

Forms!Form1.Combobox1.requery?

Thanks
 
Thanks but it's still not working. I think it has to do with my subform names. I will keep trying.


Thanks for your help
 
Maybe this will help. I found this example after looking to do something similar. The example uses a listbox but the concept is still there.

I don't remember where I got this example from. All credit goes to them... I did not create this example database.
 

Attachments

Users who are viewing this thread

Back
Top Bottom