Specific report

K

K Crofts

Hi, i have a report that runs at the click of a command
button. The problem is that the report is printing a
report for each record, not just teh selected date (my
records are defined by the date field).
I need teh report to print just for the date shown on the
record at teh time, any ideas? below is my code for the
button. and thank you in advance.

Private Sub Command84_Click()
On Error GoTo Err_Command84_Click

Dim stDocName As String
Dim strWhere As String
strWhere = "DateField=#" & _
Me.Calendar1 & "#"
stDocName = "10aConf"
DoCmd.OpenReport stDocName, acNormal, , strWhere

Exit_Command84_Click:
Exit Sub
Private Sub
Err_Command84_Click:
MsgBox Err.Description
Resume Exit_Command84_Click

End Sub
 
M

Mark Hyland

Hi,

Can I ask what the report is based on. If the source is a query, you could
add criteria to the query to filter for the date in a field, eg in the
query, add criteria like
forms![formname]![datefield].

When the query is run, it will filter records based on the field on the
form. You could then open the report from the form,

hth

Mark

This information is provided "as is" and expresses no warranties or confers
no rights.
 
K

K Crofts

Hi. report Source is my table, this is a very
straightforward programme where a form enters data in the
table and the report extracts directly from the table
also. The report comes out fine but it ius just the date
thing that i cannot figure. any ideas?
 

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

Similar Threads

Help!! 3
Date defined report 1
Select printer 1
Adding control to report 2
Printer selection 0
adding another control 1
Use combo to print report between two sets of dates 1
acPreview with filter 1

Top