Combo box in form - subform

Zinemon

Registered User.
Local time
Today, 00:09
Joined
Jun 12, 2007
Messages
11
Hello everyone,

In my form, I have a Combo box, and my subform is not following it, although I already defined the child field link and the master field link. Morevoer I've already defined the relationship between the 2 tables. Why isn't it working then?

Thanks a lot
 
Hi, Zinemon!

I suppose it is not working because there is probably missing one thing- and it is that after you select one desired value from the list of combobox, your cursor on the main form should be probably moved to the record that belongs to your selection. E.g.- in combobox you have only the names you can select. After selecting desired name the main form should go to the selected record- means the name. By changing the current record to selected value your subform will react showing the Name detail e.g.

Or maybe I did not understand your problem correctly.

Krava
 
Thanks for your help Krava, but I'm sorry I didn't get what you were trying to explain. What didn't you understand in my message?
And isn't it possible, just by choosing a record in the combo box of the form, for the subform to adapt to the chosen record?

Thanks,

Zinemon
 
Hi, Zinemon!

I only was not sure if I cought your problem correctly.

Anyhow, I will try to explain my idea in detail:
If you have main form, on that form ComboBox, this ComboBox is independent object on the form. So if you set up RowSource for the CB (ComboBox) that could be some table/query, selecting the record in CB means you will set the value of CB to value of bound column of CB. Nothing else. From my understanding- the Subform linked to Main form via Parent and Child fields changes its value (content) only in case that current record of the main form is changed. But I am not sure- there is no record in main form isn't it? I have no experience in linking Only CB and Subform at all. What I normally do in such as cases is that I set up a RecordSource of the main form the same as in CB. I place TextField (bound) on the main form and it is supposed to be the field I wand to make link with Subform. Then, I set up on CB's afterupdate event that after selecting the record from CB the current record of Main form is found- means the CurrentRecord changes of the Main form changes to selected record from CB. This even caauses reaction of subform as it is linked.
Sorry, difficult to explain. Maybe you can post the sample of your db, if possible, but I work with Access200.

Krava
 
Zinemon,

You could try filtering the subform by editing your query. If you used a query to arrive at your subform, go back to the query and do the following:

You must have the same control in the subform as in the main form (combobox) for it to work.

In the query design view of your subform under the ComboBoxName control use:

In the criteria field enter:
=Forms![MainFormName]![MainFormComboBoxName]

Whenever you select a value in the combo box on your main form it will filter the subform to show only that record.

Best Regards,
Jermaine
 

Users who are viewing this thread

Back
Top Bottom