Combo rowsource question

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]);
 
J

Junior

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]);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top