Open report button

cathalfarrell

Registered User.
Local time
Today, 10:02
Joined
Mar 10, 2008
Messages
41
Hi All,

I have searched for this on the forum and found a few threads on the subject, however I still can't seem to get this to work in my database.

I would like to view a report 'DailyLog' based on criteria selected on form 'DateTrainerPicker'. I would like to search by employee name and/or date.

However the report appears blank!

Can anyone help?

Many thanks
Cathal
 

Attachments

Last edited:
How, exactly, are you supplying the criteria? Be explicit - if using a form, how are you trying to limit it to the results? Are you doing the criteria in the query, in the where of the code that opens the report?
 
Thanks for you help Bob

Sorry I should have been more specific;

I want to select the criteria from a combo box and Microsoft Date Control on my form 'DateTrainerPicker'

I would like to run the 'TotalHours' query with these criteria and then preview the 'TotalHoursByDay' report based on the results of that query.

Is this even possible, I'm a bit new to databases and access so I may be doing this back to front
 
Thanks Again Bob

Thanks Bob,

your sample really helped me understand some issues I was having difficulty getting my head around.

I've managed to get 'frmSelect' to open my report with the employee name as criteria, however I can't seem to get the date filter to work.

Would you mind having a look to see where I have gone wrong.

Thanks so much for your help.

Cathal
 

Attachments

You will need to create a new button to use both filters or make the adjustment to the two open buttons on you form to this.
"Private Sub cmdOpDateRange_Click()
DoCmd.OpenReport "rptTotalHoursByDay", acViewPreview, , "[TodaysDate] Between #" & Me.cboFrom & "# And #" & Me.cboTo & "#"
DoCmd.OpenReport "rptHoursByTrainerDate", acViewPreview, , "[Name]='" & Me.cboCompanyName & "'"
End Sub"

Hope this helps.

If someone has helped you, click on the scales on the upper right of their post to add to their reputation.
 
Thanks Patty

Thank you Patty, but this is not quite what I was looking for.

Your code opens up both reports based on the employee and date.

Which is helpfull, but I'm still having the initial problem with my date range.

If I select range 03/03/08 - 04/03/08 it displays all the results through to present, instead of just one day.
 

Users who are viewing this thread

Back
Top Bottom