Specific report

  • Thread starter Thread starter K Crofts
  • Start date Start date
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
 
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.
 
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?
 
Back
Top