A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Forms used to run query



 
 
Thread Tools Display Modes
  #1  
Old March 15th, 2010, 05:34 PM posted to microsoft.public.access
Arlene
external usenet poster
 
Posts: 299
Default 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  
Old March 15th, 2010, 05:58 PM posted to microsoft.public.access
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old March 16th, 2010, 02:59 PM posted to microsoft.public.access
Arlene
external usenet poster
 
Posts: 299
Default 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  
Old March 16th, 2010, 04:00 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old March 16th, 2010, 04:47 PM posted to microsoft.public.access
Arlene
external usenet poster
 
Posts: 299
Default 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  
Old March 16th, 2010, 06:10 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old March 19th, 2010, 12:31 PM posted to microsoft.public.access
Arlene
external usenet poster
 
Posts: 299
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.