Previewing Reports

R

Rambo

Hi,

I am kind of new at access so i was hoping someone might be able to
help out with this question. I am setting up a database for my company
and want to be able to display progress reports for employees. Right
now I have it set up where I press the "Preview report" and all of the
reports for a particular employee come up, however, I would just like
it to display the report for that particular day. The code that I have
typed for the "Preview Report" button is below

Private Sub cmdPreviewRecord_Click()
Dim strReportName As String
Dim strCriteria As String

strReportName = "rptProgressReport"
strCriteria = " [strEmployeeID] =' " & Me![strEmployeeID] & " ' "
DoCmd.OpenReport strReportName, acViewPreview, ,strCriteria

End Sub

My date field is named "dtmDateofProgress"

Any help on the issue would be greatly appreciated. Thanks

Sincerely,
Rambo
 
R

Rick Brandt

Rambo said:
Hi,

I am kind of new at access so i was hoping someone might be able to
help out with this question. I am setting up a database for my
company and want to be able to display progress reports for
employees. Right now I have it set up where I press the "Preview
report" and all of the reports for a particular employee come up,
however, I would just like it to display the report for that
particular day. The code that I have typed for the "Preview Report"
button is below

Private Sub cmdPreviewRecord_Click()
Dim strReportName As String
Dim strCriteria As String

strReportName = "rptProgressReport"
strCriteria = " [strEmployeeID] =' " & Me![strEmployeeID] & " ' "
DoCmd.OpenReport strReportName, acViewPreview, ,strCriteria

End Sub

My date field is named "dtmDateofProgress"

You just need to add that to your strCriteria...

strCriteria = "[strEmployeeID] = '" & Me![strEmployeeID] & "' AND
dtmDateofProgress = Date()"
 
R

Rambo

Rick said:
Rambo said:
Hi,

I am kind of new at access so i was hoping someone might be able to
help out with this question. I am setting up a database for my
company and want to be able to display progress reports for
employees. Right now I have it set up where I press the "Preview
report" and all of the reports for a particular employee come up,
however, I would just like it to display the report for that
particular day. The code that I have typed for the "Preview Report"
button is below

Private Sub cmdPreviewRecord_Click()
Dim strReportName As String
Dim strCriteria As String

strReportName = "rptProgressReport"
strCriteria = " [strEmployeeID] =' " & Me![strEmployeeID] & " ' "
DoCmd.OpenReport strReportName, acViewPreview, ,strCriteria

End Sub

My date field is named "dtmDateofProgress"

You just need to add that to your strCriteria...

strCriteria = "[strEmployeeID] = '" & Me![strEmployeeID] & "' AND
dtmDateofProgress = Date()"


Wow, that was fast...thanks a bunch Mr. Brandt!

Sincerely,
Rambo
 
R

Rambo

Rick said:
Rambo said:
Hi,

I am kind of new at access so i was hoping someone might be able to
help out with this question. I am setting up a database for my
company and want to be able to display progress reports for
employees. Right now I have it set up where I press the "Preview
report" and all of the reports for a particular employee come up,
however, I would just like it to display the report for that
particular day. The code that I have typed for the "Preview Report"
button is below

Private Sub cmdPreviewRecord_Click()
Dim strReportName As String
Dim strCriteria As String

strReportName = "rptProgressReport"
strCriteria = " [strEmployeeID] =' " & Me![strEmployeeID] & " ' "
DoCmd.OpenReport strReportName, acViewPreview, ,strCriteria

End Sub

My date field is named "dtmDateofProgress"

You just need to add that to your strCriteria...

strCriteria = "[strEmployeeID] = '" & Me![strEmployeeID] & "' AND
dtmDateofProgress = Date()"


Wow, that was fast...thanks a bunch Mr. Brandt!

Sincerely,
Rambo
 
R

Rambo

Rambo said:
Rick said:
Rambo said:
Hi,

I am kind of new at access so i was hoping someone might be able to
help out with this question. I am setting up a database for my
company and want to be able to display progress reports for
employees. Right now I have it set up where I press the "Preview
report" and all of the reports for a particular employee come up,
however, I would just like it to display the report for that
particular day. The code that I have typed for the "Preview Report"
button is below

Private Sub cmdPreviewRecord_Click()
Dim strReportName As String
Dim strCriteria As String

strReportName = "rptProgressReport"
strCriteria = " [strEmployeeID] =' " & Me![strEmployeeID] & " ' "
DoCmd.OpenReport strReportName, acViewPreview, ,strCriteria

End Sub

My date field is named "dtmDateofProgress"

You just need to add that to your strCriteria...

strCriteria = "[strEmployeeID] = '" & Me![strEmployeeID] & "' AND
dtmDateofProgress = Date()"


Wow, that was fast...thanks a bunch Mr. Brandt!

Sincerely,
Rambo

Mr. Brandt,

I tried what youi had told me...but I keep getting a runtime error

I typed the code as follows

strCriteria = "[strEmployee ID] =" ' " & Me![strEmployeeID] & " '" AND
"[dtmDateofProgress] = Date()"

Did I do it correctly?

Thanks,
Rambo
 
D

Duane Hookom

At least one reply in a more recent thread. From now on, please keep
questions in a single thread.

--
Duane Hookom
MS Access MVP

Rambo said:
Rick said:
Rambo wrote:
Hi,

I am kind of new at access so i was hoping someone might be able to
help out with this question. I am setting up a database for my
company and want to be able to display progress reports for
employees. Right now I have it set up where I press the "Preview
report" and all of the reports for a particular employee come up,
however, I would just like it to display the report for that
particular day. The code that I have typed for the "Preview Report"
button is below

Private Sub cmdPreviewRecord_Click()
Dim strReportName As String
Dim strCriteria As String

strReportName = "rptProgressReport"
strCriteria = " [strEmployeeID] =' " & Me![strEmployeeID] & " ' "
DoCmd.OpenReport strReportName, acViewPreview, ,strCriteria

End Sub

My date field is named "dtmDateofProgress"

You just need to add that to your strCriteria...

strCriteria = "[strEmployeeID] = '" & Me![strEmployeeID] & "' AND
dtmDateofProgress = Date()"


Wow, that was fast...thanks a bunch Mr. Brandt!

Sincerely,
Rambo

Mr. Brandt,

I tried what youi had told me...but I keep getting a runtime error

I typed the code as follows

strCriteria = "[strEmployee ID] =" ' " & Me![strEmployeeID] & " '" AND
"[dtmDateofProgress] = Date()"

Did I do it correctly?

Thanks,
Rambo
 
R

Rick Brandt

Rambo said:
Rambo said:
Rick said:
You just need to add that to your strCriteria...

strCriteria = "[strEmployeeID] = '" & Me![strEmployeeID] & "' AND
dtmDateofProgress = Date()"
Mr. Brandt,

I tried what youi had told me...but I keep getting a runtime error

I typed the code as follows

strCriteria = "[strEmployee ID] =" ' " & Me![strEmployeeID] & " '" AND
"[dtmDateofProgress] = Date()"

Did I do it correctly?

No, your quotes are wrong. Try pasting exactly what I posted except all on
one line.
 

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