If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Select Data Source Based On Outcome Of
I have a form that does not have a record source assigned to it. In the form
I have a combo box, and, after selecting something in the combo box I want the form to be connected to a table or query. Don't know if this is possible. Chai |
#2
|
|||
|
|||
Select Data Source Based On Outcome Of
set the form's recordsource in the AfterUpdate event of the combo box
Chai wrote: I have a form that does not have a record source assigned to it. In the form I have a combo box, and, after selecting something in the combo box I want the form to be connected to a table or query. Don't know if this is possible. Chai -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201002/1 |
#3
|
|||
|
|||
Select Data Source Based On Outcome Of
Here one way but all sources must have same fields or be able to be displayed
by a set of generic field aliases. Base the form on a union query that uses a control (combo with 2 columns) for criteria to determine which portion of the union query will have any records to output. SELECT tbl1.SomeName AS T_Name, tbl1.Name_X AS U_Name, tbl1.Name_Y AS V_Name FROM tbl1 WHERE [Forms]![MyForm]![cbo1] = 1 UNION ALL SELECT tbl2.OtherName AS T_Name, tbl2.Q_Name AS U_Name, tbl2.N_Name AS V_Name FROM tbl2 WHERE [Forms]![MyForm]![cbo1] = 2 UNION ALL SELECT tbl3.Other AS T_Name, tbl3.VR_Name AS U_Name, tbl3.CB_Name AS V_Name FROM tbl3 WHERE [Forms]![MyForm]![cbo1] = 3; You will need an AfterUpdate event on combo to refresh the query. -- Build a little, test a little. "Chai" wrote: I have a form that does not have a record source assigned to it. In the form I have a combo box, and, after selecting something in the combo box I want the form to be connected to a table or query. Don't know if this is possible. Chai |
Thread Tools | |
Display Modes | |
|
|