Querry on current record

R

Rick Patterson

I have a form used to enter daily time sheets for technicians. To
facilitate multiple entries for each tech each day I use a sub form which
enters details about each job and references those jobs to the daily
JobSheet. When each job is entered the JobDetail Sub form clears for the
next entry if any. I would like a button on the form to activate a report
or querry to summarize that particular JobSheet's (Days) activity for that
technician (all of the detail records associated with that sheet). By doing
this I can verify that the data went in correctly before going on to the
next JobSheet. I'm having trouble trying to limit the querry to just the
current JobSheetID.
Any words of wisdom would be helpful to this impossible novice.
Thank You.
 
R

Rick Patterson

Maybe what I need to do in my querry is sort the JobSheetID by the last
JobSheetID number. If so I need help with this also. Sorry for the
ignorance or being so vauge.

Thanks for any input.
 
D

Duane Hookom

You can use the command button wizard to create the code to open the report.
Then add some lines to your code. This assumes:
- JobSheetID is numeric
- the main form name is "frmTimeEntry"
- the sub form control name is "sfrmJobDetail"
- There is a text box on the main form txtJobSheetID
that contains the value of JobSheetID
- The command button is on the main form

Add these lines of code:
Dim strWhere as String
strWhere = "[JobSheetID] = " & Me.txtJobSheetID
Modify your DoCmd.OpenReport line
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top