Opening report to unique date (1 Viewer)

RyLane

Registered User.
Local time
Today, 05:12
Joined
Feb 4, 2014
Messages
60
Hi,
I want to tweak an existing form that currently allows me to generate a report based on a name and date selected.

The issue now is that there are some records that have the same date and I want to be able to generate a report on them seperately.

i.e. Jane has 2 records for December 5 with unique ID's

Right now when I generate the report it goes by the date and so I have both records.

To open the report I have this right now:

DoCmd.OpenReport "SelectPSReport", acViewPreview, , "[PS_Agent]='" & Me.CboAgt & "' And [PS_dDate]=#" & Me.Cbodt.Column(1) & "#"


How do I now get the report to generate off the ID and not the date?

No sure if it matters, but my form is populated by choosing a name in a combo box then the date in another combo box. Its the date combo that finds the record for the form.

Thanks,
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:12
Joined
Jan 23, 2006
Messages
15,378
DoCmd.OpenReport "SelectPSReport", acViewPreview, , ID=

If the ID is a number, just put that number after the = sign.

Untested*********

Post back if there are more issues/questions.
 

RyLane

Registered User.
Local time
Today, 05:12
Joined
Feb 4, 2014
Messages
60
That number changes though depending on which date is selected. I know I need to set ID= to something that captures that change, and not just a set number.
 

RyLane

Registered User.
Local time
Today, 05:12
Joined
Feb 4, 2014
Messages
60
Got it to work with:

DoCmd.OpenReport "Copy of PSReport", acViewPreview, , "[PS_Agent]='" & Me.cboName & "' And [PS_dDate]=#" & Me.cboDate.Column(1) & "# And [ID]=" & Me.[ID].Value
 

Users who are viewing this thread

Top Bottom