Combo rowsource question

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

Is it possible to change the Rowsource of a combobox based on a selection in
another control

i.e. I want to use the same cbobox to select from different tables depending
on the togglebutton selected -

Why, a parameter query uses the the cbo selection and i'm expanding an old
DB



If below is possible could someone tell me how or ;-) provide sample SQL -
or maybe a different solution - Thanks



Example: Using an option group with toggle buttons



If ToggleOne =1 then Rowsource would be



SELECT [TblOne].[ID], [TblOne].[Desc] FROM TblOne WHERE TblOne.GDE="A" ORDER
BY [TblOne].[PrintOrder]);



If toggleTwo = 1 Then Rowsource would be



SELECT [TblTwo].[ID], [TblTwo].[Desc] FROM TblTwo WHERE TblTwo.GDE="B" ORDER
BY [TblTwo].[PrintOrder]);
 
Super! thanks for the tip -
Douglas J. Steele said:
Sure. Use something like:

Me.cboCombo.RowSource = strSQL

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Junior said:
Is it possible to change the Rowsource of a combobox based on a
selection
in
another control

i.e. I want to use the same cbobox to select from different tables depending
on the togglebutton selected -

Why, a parameter query uses the the cbo selection and i'm expanding an old
DB



If below is possible could someone tell me how or ;-) provide sample SQL -
or maybe a different solution - Thanks



Example: Using an option group with toggle buttons



If ToggleOne =1 then Rowsource would be



SELECT [TblOne].[ID], [TblOne].[Desc] FROM TblOne WHERE TblOne.GDE="A" ORDER
BY [TblOne].[PrintOrder]);



If toggleTwo = 1 Then Rowsource would be



SELECT [TblTwo].[ID], [TblTwo].[Desc] FROM TblTwo WHERE TblTwo.GDE="B" ORDER
BY [TblTwo].[PrintOrder]);
 
Back
Top