CanuckBuck
Registered User.
- Local time
- Today, 00:44
- Joined
- Apr 27, 2019
- Messages
- 31
Is it possible to use Me.ControlName.Value (or Me.Name) as input to a query that supplies values for a combo box?
I need to populate a combo box's list of values with values which are appropriate to the form, based on the form's name. I need to create a number (eleven) of these forms (They're all similar in function but contain more or fewer controls based on their purpose).
I'm hoping to be able to do this by using Me. notation so that I didn't have to go into the query for the combo box on each of the eleven forms and change the form name.
Is this possible?
Here's the code of my combo box's RowSource query.
I'd like to replace
with something equivalent to
I need to populate a combo box's list of values with values which are appropriate to the form, based on the form's name. I need to create a number (eleven) of these forms (They're all similar in function but contain more or fewer controls based on their purpose).
I'm hoping to be able to do this by using Me. notation so that I didn't have to go into the query for the combo box on each of the eleven forms and change the form name.
Is this possible?
Here's the code of my combo box's RowSource query.
Code:
SELECT DISTINCT
R_Application_Group.Name,
R_Application_Group.DB_Key
FROM (R_Application_Group
INNER JOIN Application_Class ON R_Application_Group.DB_Key = Application_Class.Group_DB_Key)
INNER JOIN AppTracker_Form ON Application_Class.AppTracker_Form_DB_Key = AppTracker_Form.DB_Key
WHERE
R_Application_Group.Effective_Date <= Date()
AND (R_Application_Group.Obsolete_Date Is Null Or R_Application_Group.Obsolete_Date >= Date())
AND AppTracker_Form.Name = [Forms]![Main Form - PNoA Entries - Edit]![AppTracker_Form_Name];
I'd like to replace
Code:
[Forms]![Main Form - PNoA Entries - Edit]![AppTracker_Form_Name]
Code:
Me.[AppTracker_Form_Name]