Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module Help

Status
Not open for further replies.

zmclean

IS-IT--Management
Dec 14, 2004
1
US
I have an issue with an old database that we use for Evaluations for employees some lady wrote it and I cant figure out what to do with something in it. There is a button in one of the forms that is suppose to creat blank evals for the next year using a sql query but i have no idea about programming so i will post it below and any help would be greatly apprecitated. Thanks


Private Sub AddEvalsBtn_Click()
Dim NowDate As Date

DoCmd.RunSQL "INSERT INTO Evaluation ( EmployeeID, ManagerID, JobCode, Dept, Shift, HireDate )" & _
" SELECT Evaluation.EmployeeID, Evaluation.ManagerID, Evaluation.JobCode, Evaluation.Dept, Evaluation.Shift, Evaluation.HireDate" & _
" FROM Evaluation" & _
" WHERE (((Evaluation.ReviewDate) > #12/31/04# - 365))" & _
" GROUP BY Evaluation.EmployeeID, Evaluation.ManagerID, Evaluation.JobCode, Evaluation.Dept, Evaluation.Shift, Evaluation.HireDate;"

[Forms]![SA_MtEvalSetup]![Sub1].Form.Requery
End Sub
 
When you click a button, this code adds records into a table called "Evaluation" a bunch of records from the same table (essentially copying them). The records it's copying are those where the 'ReviewDate' field is greater than or equal to 1/1/04.

So it looks like they are perhaps setting up a new evaluation, copying employee records for the new evaluation?
 
This append query seems to insert a new record in the Evaluation table with default ReviewDate for each EmployeeID having a ReviewDate this year.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top