date search in a form??

daneo2k3

Registered User.
Local time
Today, 11:31
Joined
Nov 27, 2003
Messages
81
how can i create a form were you can type the two dates you want to show between from another table and a list of employees from another table then a button on the form which creates a report showing the employee you chose from the list and the dates you entered??? any help much appreciated dane??? i can send my database to show you if it helps?
 
Base the report on a query.

In the criteria of the query put references to the form.

i.e.

Between [Forms]![MyForm]![txtStartDate] And [Forms]![MyForm]![txtEndDate]
 
and this will work for any date i type in???
 
You will also need to put criteria on the column of your query that contains the employee in question. Also, search Access help on the Nz function to handle controls that are left empty. But yes, it will work "any data [you] type in".

--Fan-Of-Mile Mac
 
When i try to create a report on my query it brings up a msg saying:

You tried to execute a query that does not include the specified expression'[Forename] &" " &[surname]' as part of an aggregate function.

what have i done wrong this time??
dane
 
[Forename] &" " &[surname]

Put spaces between them:

[Forename] & " " & [surname]


If that doesn't work; post your SQL.
 
SELECT [Forename] & " " & [Surname] AS Employee, tblJobs.DateWorked, tblLocations.LocationID, tblRatesOfPay.RateOfPay, Sum([RateOfPay]) AS Expr1, tblEmployees.EmployeeID
FROM (tblLocations INNER JOIN (tblEmployees INNER JOIN tblJobs ON tblEmployees.EmployeeID = tblJobs.EmployeeID) ON tblLocations.LocationID = tblJobs.LocationID) INNER JOIN tblRatesOfPay ON tblLocations.LocationID = tblRatesOfPay.LocationID
WHERE (((tblJobs.DateWorked) Between [Forms]![MyForm]![txtStartDate] And [Forms]![MyForm]![txtEndDate]) AND ((tblEmployees.EmployeeID)=[Forms]![MyForm]![cboEmployees]));
 

Users who are viewing this thread

Back
Top Bottom