Topics Search

Populate subform based on combobox values in the main form

Populate subform based on combobox values in the main  form
Views: 159
I have a form which contains 3 combo boxes. These combo boxes contain values from tables. These combo boxes are unbound.
I have a Details subform, which I have to populate based on the values in combo boxes. The subform is bound.
Sponsored Links:

More topics


Combo Box Filter

I am using a combobox filter on a mainform which has a subform.

I need to populate a combobox filter on a subform based on what is selected on a filter combobox on my mainform but no matter what I try I can't seem to get this to work.

I can populate the combobox filter on the subform using a normal combobox on that same form but can't populate the combobox filter on the subform using the filter on the main form.

I am aware that there is different syntax used to access a control on a subform and am 100% sure my syntax is perfect.

Filter subForm comboBox based on main form combobox selection - SAMPLE ATTACHED

Here is my problem. I am trying to filter a combobox on a subform based on a combobox on my main form. I am successfully able to do this with two combo boxes on the same mainform but not with one on the mainform and one on the subform. I have attached a sample database with the tables, queries, and forms associated with this issue.

I have read numerous topics on this site relating to this topic and I have tried all the responses but I just keeping getting lost in the middle of the

Filter subform based on combobox on main form

I need to filter the subform based on the combobox(Unbound) in the main form. After filtering I need to add some values. Below is the code I put in after update of combobox but I get error 424.

Client_info is table name
id is field name
cboid is combobox name in mainform
client_info_sub is subform name

Private Sub cboid_AfterUpdate()
Dim LSQL As String

LSQL = "select * from Client_Info"
LSQL = LSQL & " where ID = '" & cboId & "'"

Form_Client_Info_sub.RecordSource = LSQL

Subform empty when main form loaded

I have a mainform which contains two subforms

The first subform contains all records from a table and loads perfectly fine when the main form is opened

The second displays a subset of the same records based - a list of records for a selected company ID, this in contrast to the first subform appears blank when the main form opens.

I can manually populate the blank subform by pressing F5, adding a refresh button (uses me.reacalc) and by making the comany ID field a combox and using an after update event that refreshes the form.

I would like the empty subform to populate using the company ID selected when the form is opened (this comes from another form).

I have tried re-calculating the form using several events such as AfterUpdate - but can not get this subform to populate

cascade combobox problem.

I have two comboboxes on a subform. The first combobox is used to populate the second combobox. These are placed in the detail section of the form.I want them to work this way:when I select any value from the first combobox,I want the second combobox of the same row to get populated by relevant value.

As of now, I have tried to implement this and as I select any value from the first combobox of row 1 I see the second combobox of the same row gets populated but as I go on selecting values from the first set of comboboxes I see that the values in the second set of the comboboxes above changing or becoming null.

The 1st combobox is cboRCMTask:

Query based on subform combobox

I am trying to build a query based on a combobox that is on a subform that cascades from a combobox on a main form. So far I have :
INSERT INTO tblSubTeamEvent ( SubTeamID, EventID )
VALUES (Me!SubFormSubTeamForm.Form!cmboSubTeamSF, [Forms]![frmEvent]![EventID]);
but when I run it it asks for the parameter value of the cmboSubTeamSF. If I just ignore the question it still updates the EventID into the table but obviously not the SubTeamID. I've tried various combinations of Me! Forms! etc but can't get it to work any ideas any one

Requerying Subform Issues!!!

Have a main form that contains a subform. The main form data comes from a table and the subform gets its data from a query. The main form has a combobox that I use to write criteria to the query of the subform.

The combo box operates properly. I see all my data in the combo box. My issue is when I select data in my combobox, lets say the number 99, nothing happens in my subform.

If I change records of my main form and come back to the previous record, the "99" is showing in the subform along with the other data I want.

I want the subform to change as soon as I select my data in my combobox. I wrote some code so when the combobox updates, it requerys the subform. But what happens, the subform requerys, and just the field that my combobox writes to updates, the other fields are blank.

Then, if I change main records and come back, the data is there. What am I missing?

Text box based on combo inside subform

I have a subform located inside my main form. The subform is linked to the main form so the data shown in the subform matches the main form.

I have added a combo box to the subform and I'd like to have it populate the fields in the subform, but still have the entire subform linked to the main form.

Referencing Issue

I have a subform within a main form. I want to update a combobox in the subform depending on a value in the mainform, but are struggling to reference the combobox in the subform. The VBA editor doesn't recognise the combobox name

Main Form ComboBox to Filter Records in SubForm

I have a problem filtering records in my subform using a ComboBox in the Main Form. I have tried options proferred in other forums and have still not git the desired result. I know I must be missing something as this looks quite simple.

I have attached a screenshot to help.

What I need to for the records to be filtered by the Section Field using either of the three options in the ComboBox. The ComboBox looksup data from a Sections table (SectionID, Section).

Main Table Name: Orders (Master Link: Order ID)
SubForm Table Name: Order Details (Child Link: Order ID)
ComboBox Object Name: CboFilter