Pull report by dates... and PersonID.... HELP!

morfusaf

Registered User.
Local time
Today, 07:02
Joined
Apr 24, 2012
Messages
78
Ok,

I have a database, 3 tables, tblEvents, tblPeople, tblPeopleAtEvents(Junction)


I want to have a form where I pick the person

Using the following Row Source (This just lets me see the first name and last name vs PersonID).

SELECT [tblPeople].[PersonID], tblPeople.[Last_Name], tblPeople.[First_Name] FROM tblPeople;


I then want 2 text boxes to select the date ranges...
FDate and EDate

Then I want to click a button, which passes onto a REPORT the PersonID.... then pull the events on the dates between the 2 dates passed...


I got the date range to work, but I can't seem to get the date range and the Person ID to work.... So it just pulls all events from that date range.. and not from a specific Person.


Code:
Private Sub btnOpen_Click()
On Error GoTo btnOpen_Click_Err
    DoCmd.OpenReport "tblEvents Query", acViewReport, "", "", acNormal
btnOpen_Click_Exit:
    Exit Sub
btnOpen_Click_Err:
    MsgBox Error$
    Resume btnOpen_Click_Exit
End Sub

My current buttons code... I seem to think that I somehow need to put Person ID in the whereCondition... but don't know how to .
 
Not sure I'm following you.

You have a form where you select a person from a combo box (with PersonID as the bound field) and then you enter start and end dates in two text boxes. Is this correct?

Normally in this scenario you would create a query that references these form controls in its criteria and then use the query as the record source of your report.
 

Users who are viewing this thread

Back
Top Bottom