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
|
|||
|
|||
Forms used to run query
I created a form from where the information is selected to run the query. The
problem is that I want to pull information from two different columns inthe query. In other words, I have a query that pulls information from 5 differente tables. I need to query the info by building/department and by full name column. I created a form from where the user can select the building to run the query, but I also want to get the employees full name, only employees located in that building so that I can run a report based on that employee. I hope I make sense! Any help would be greatly appreciate it. |
#2
|
|||
|
|||
Forms used to run query
I hope I make sense!
Yeah, but you did not post the SQL of your query so others could suggest changes. -- Build a little, test a little. "Arlene" wrote: I created a form from where the information is selected to run the query. The problem is that I want to pull information from two different columns inthe query. In other words, I have a query that pulls information from 5 differente tables. I need to query the info by building/department and by full name column. I created a form from where the user can select the building to run the query, but I also want to get the employees full name, only employees located in that building so that I can run a report based on that employee. I hope I make sense! Any help would be greatly appreciate it. |
#3
|
|||
|
|||
Forms used to run query
On the query I have the following:
[Forms]![FrmSelectInfoforPosting]![SelectYourBuilding] [Forms]![FrmSelectInfoforPosting]![SelectEmployee] "KARL DEWEY" wrote: I hope I make sense! Yeah, but you did not post the SQL of your query so others could suggest changes. -- Build a little, test a little. "Arlene" wrote: I created a form from where the information is selected to run the query. The problem is that I want to pull information from two different columns inthe query. In other words, I have a query that pulls information from 5 differente tables. I need to query the info by building/department and by full name column. I created a form from where the user can select the building to run the query, but I also want to get the employees full name, only employees located in that building so that I can run a report based on that employee. I hope I make sense! Any help would be greatly appreciate it. |
#4
|
|||
|
|||
Forms used to run query
On Tue, 16 Mar 2010 07:59:01 -0700, Arlene
wrote: On the query I have the following: [Forms]![FrmSelectInfoforPosting]![SelectYourBuilding] [Forms]![FrmSelectInfoforPosting]![SelectEmployee] What Karl's asking is to see the entire query. To post it here, open the query in design view, and choose View... SQL on the menu. Copy and paste the SQL text to a message here. It may also help to describe the structure of your table(s), if that isn't obvious. -- John W. Vinson [MVP] |
#5
|
|||
|
|||
Forms used to run query
It is a large query, but here it is:
SELECT tblposition.PositionID, tblposition.JobClassification, tblposition.UnitClassification, tblposition.PositionCode, tblposition.PositionDescription, tblposition.PositionFTE, tblposition.HoursPerDay, tblposition.DaysPerYear, tblBuildingPosition.BuildingPositionFTE, tblBuildingPosition.PositionStatus, tblBuildingPositionBudget.BudgetCodeFTE, tblEmployee.EmployeeId, tblEmployee.SSN, tblEmployee.LastName, tblEmployee.FirstName, tblEmployee.MiddleName, tblBuildingPositionBudget.BudgetCodeID, tblBudgetCode.Fund, tblBudgetCode.Function, tblBudgetCode.Object, tblBudgetCode.Funding, tblBudgetCode.InstructionalUnit, tblBudgetCode.Building, tblBudgetCode.Subject, tblBudgetCode.JobClass, tblBudgetCode.CostCenter, tblBuildingPosition.Building FROM tblposition INNER JOIN (tblEmployee INNER JOIN (tblBuildingPosition INNER JOIN (tblBuildingPositionBudget INNER JOIN tblBudgetCode ON tblBuildingPositionBudget.BudgetCodeID = tblBudgetCode.BudgetCodeID) ON tblBuildingPosition.BuildingPositionID = tblBuildingPositionBudget.BuildingPositionID) ON tblEmployee.EmployeeId = tblBuildingPosition.EmployeeID) ON tblposition.PositionID = tblBuildingPosition.PositionID; I am using all of this information on a report, but what I need is that the user choose their building and then select the employee in their building. "John W. Vinson" wrote: On Tue, 16 Mar 2010 07:59:01 -0700, Arlene wrote: On the query I have the following: [Forms]![FrmSelectInfoforPosting]![SelectYourBuilding] [Forms]![FrmSelectInfoforPosting]![SelectEmployee] What Karl's asking is to see the entire query. To post it here, open the query in design view, and choose View... SQL on the menu. Copy and paste the SQL text to a message here. It may also help to describe the structure of your table(s), if that isn't obvious. -- John W. Vinson [MVP] . |
#6
|
|||
|
|||
Forms used to run query
On Mon, 15 Mar 2010 10:34:01 -0700, Arlene
wrote: I created a form from where the information is selected to run the query. The problem is that I want to pull information from two different columns inthe query. In other words, I have a query that pulls information from 5 differente tables. I need to query the info by building/department and by full name column. I created a form from where the user can select the building to run the query, but I also want to get the employees full name, only employees located in that building so that I can run a report based on that employee. I hope I make sense! Any help would be greatly appreciate it. It sounds like what you need is a "conditional combo box". On your form you have two combo boxes; I'll call the form frmFind and the combo boxes cboBuilding and cboEmployee (you use your own names of course!) Base cboEmployee on a Query referencing the building combo box as a criterion: =[Forms]![frmFind]![cboBuilding] Also, Requery cboEmployee in the AfterUpdate event of cboBuilding. This will let you select a building; once you have done so the combo box for employees will show only those employees in that building. Either or both combo boxes can then be used as criteria in the Report's recordsource. -- John W. Vinson [MVP] |
#7
|
|||
|
|||
Forms used to run query
Thank you so much!!!!
"John W. Vinson" wrote: On Mon, 15 Mar 2010 10:34:01 -0700, Arlene wrote: I created a form from where the information is selected to run the query. The problem is that I want to pull information from two different columns inthe query. In other words, I have a query that pulls information from 5 differente tables. I need to query the info by building/department and by full name column. I created a form from where the user can select the building to run the query, but I also want to get the employees full name, only employees located in that building so that I can run a report based on that employee. I hope I make sense! Any help would be greatly appreciate it. It sounds like what you need is a "conditional combo box". On your form you have two combo boxes; I'll call the form frmFind and the combo boxes cboBuilding and cboEmployee (you use your own names of course!) Base cboEmployee on a Query referencing the building combo box as a criterion: =[Forms]![frmFind]![cboBuilding] Also, Requery cboEmployee in the AfterUpdate event of cboBuilding. This will let you select a building; once you have done so the combo box for employees will show only those employees in that building. Either or both combo boxes can then be used as criteria in the Report's recordsource. -- John W. Vinson [MVP] . |
Thread Tools | |
Display Modes | |
|
|