JuniorWoodchuck24
Registered User.
- Local time
- Today, 10:53
- Joined
- Jan 13, 2010
- Messages
- 59
I'm trying to code a combo box that based on a previous project selection the combo box will list items from that project.
Form:
The form allows the user to select a project number. Once this project number is selected I want the next combo box to pull info from that project's table.
Tables:
ProjectInfo
101OverallProjectGroup
*OverallProjectGroup (Other Projects)
Code that I have thus far:
Dim xProjNo, xFullName, xProjectName
xProjNo = Me.cboProjectNo.Column(1) 'This pulls in the number not the ID
xProjectName = xProjNo & "OverallProjectGroup"
xFullName = "xProjectName.FirstName & ' ' & xProjectName.LastName"
cboEmployee.RowSource = "SELECT xProjectName.ID, xFullName" & _
"FROM xProjectName" & _
"ORDER BY FirstName;"
I know that if I type the following in the rowsource box for the cboEmployee I'll get a specific project but I'll have to manually change it each time:
SELECT 101OverallProjectGroup.ID, [FirstName] & " " & [LastName] FROM 101OverallProjectGroup ORDER BY FirstName;
That gets me what I want but I'm stuck with project 101
Form:
The form allows the user to select a project number. Once this project number is selected I want the next combo box to pull info from that project's table.
Tables:
ProjectInfo
101OverallProjectGroup
*OverallProjectGroup (Other Projects)
Code that I have thus far:
Dim xProjNo, xFullName, xProjectName
xProjNo = Me.cboProjectNo.Column(1) 'This pulls in the number not the ID
xProjectName = xProjNo & "OverallProjectGroup"
xFullName = "xProjectName.FirstName & ' ' & xProjectName.LastName"
cboEmployee.RowSource = "SELECT xProjectName.ID, xFullName" & _
"FROM xProjectName" & _
"ORDER BY FirstName;"
I know that if I type the following in the rowsource box for the cboEmployee I'll get a specific project but I'll have to manually change it each time:
SELECT 101OverallProjectGroup.ID, [FirstName] & " " & [LastName] FROM 101OverallProjectGroup ORDER BY FirstName;
That gets me what I want but I'm stuck with project 101