Sub Form ComboBox

  • Thread starter Thread starter mattc66 via AccessMonster.com
  • Start date Start date
M

mattc66 via AccessMonster.com

Hi All,

I have a main form with the customer number. In my subform I have a combo box
that list the order number and the associated customer number to that order.
I want to limit the list to only the customers from the main form. How would
I do that?

Thanks
Matt
 
On the OnCurrent event of your mainform, change the rowsource of the subform
combo
to the ID value of selected record on mainform.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 
Previous posting should read:

On the OnCurrent event of your mainform, change the rowsource of the subform
combo
to ID value or related ID value of selected record on mainform

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE



Perry said:
On the OnCurrent event of your mainform, change the rowsource of the
subform combo
to the ID value of selected record on mainform.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE



mattc66 via AccessMonster.com said:
Hi All,

I have a main form with the customer number. In my subform I have a combo
box
that list the order number and the associated customer number to that
order.
I want to limit the list to only the customers from the main form. How
would
I do that?

Thanks
Matt

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
 
Could you explain in a little more detail.
On the OnCurrent event of your mainform, change the rowsource of the subform
combo
to the ID value of selected record on mainform.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
[quoted text clipped - 8 lines]
Thanks
Matt
 
On the OnCurrent event of yr mainform, enter code like:

MainForm!SubFormName.Form!MyCombo.Rowsource = _
"Select * from MyCustTable where CustID = " & me.CustID

or

Me.Controls("SubForm").Form!MyCombo.RowSource = _
"Select * from MyCustTable where CustID = " & me.CustID

These pseudo code lines use the CustID of the mainform to change the
rowsource of the combo on your subform.
--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE



mattc66 via AccessMonster.com said:
Could you explain in a little more detail.
On the OnCurrent event of your mainform, change the rowsource of the
subform
combo
to the ID value of selected record on mainform.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
[quoted text clipped - 8 lines]
Thanks
Matt

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
 
That doesn't work. When I select the Combo box in my subform it just displays
the CustID. What I want to do is display all orders for that Customer. Any
thoughts?
On the OnCurrent event of yr mainform, enter code like:

MainForm!SubFormName.Form!MyCombo.Rowsource = _
"Select * from MyCustTable where CustID = " & me.CustID

or

Me.Controls("SubForm").Form!MyCombo.RowSource = _
"Select * from MyCustTable where CustID = " & me.CustID

These pseudo code lines use the CustID of the mainform to change the
rowsource of the combo on your subform.
--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
Could you explain in a little more detail.
[quoted text clipped - 16 lines]
 
How come I can just add the [MainFormName].[ControlName] on the underlined
query for the record source of the combo box on the subform? I have tried
this and it pop's a message box up and asked for the CustID if I enter that
it displays what I want. How can I get it to pick it up automatically?
On the OnCurrent event of yr mainform, enter code like:

MainForm!SubFormName.Form!MyCombo.Rowsource = _
"Select * from MyCustTable where CustID = " & me.CustID

or

Me.Controls("SubForm").Form!MyCombo.RowSource = _
"Select * from MyCustTable where CustID = " & me.CustID

These pseudo code lines use the CustID of the mainform to change the
rowsource of the combo on your subform.
--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
Could you explain in a little more detail.
[quoted text clipped - 16 lines]
 
Correction How come I can't....
How come I can just add the [MainFormName].[ControlName] on the underlined
query for the record source of the combo box on the subform? I have tried
this and it pop's a message box up and asked for the CustID if I enter that
it displays what I want. How can I get it to pick it up automatically?
On the OnCurrent event of yr mainform, enter code like:
[quoted text clipped - 21 lines]
 
Back
Top