Report for only (select Group) of people? HELP!

morfusaf

Registered User.
Local time
Today, 07:53
Joined
Apr 24, 2012
Messages
78
basically, I am trying to run a report... I have an allmembers report and seperate it by "HG_Flight" ... Alpha, Bravo, Charlie....

Now, I want to run a report that only shows the members that are in the selected "HG_Flight"



So I have a form, formMemberReports , On this form I want a Combo box to select which HG_Flight, then a run report button that runs the report and only displays those in that selected flight.... HELP?

Form= formMemberReports
Combo box = cboWhichFlight
Run report button = btnRunByFlightReport
Report = rptByFlightMembers
Table = tblPeople
Field for HG_flight = HG_Flight






I figure I need a query of sorts, and maybe a where condition but I am not sure how to get this to work.
 
Last edited:
Can't get that to seem to work.
 
I am using the follow
Code:
 DoCmd.OpenReport "rptByFlightMembers", , , "HG_Flight = '" & Me.cboWhichFlight & "'"

It just runs the report for everything, and then Prints it on my printer... (not sure why its printing it... ).
 
OK, I changed the code to this

Code:
   DoCmd.OpenReport "rptByFlightMembers", , , "tblPeople.HG_Flight = '" & Me.cboWhichFlight & "'"

Now, It kinda works... What happens is, I click the button, and BOOM it prints onto my printer... but what it prints out is the correct product...

How do I get this to not Print, and just show the report? kinda waisting alot of my paper... I don't know why this button is printing.
 
Look at OpenReport in VBA help; one of the arguments you skipped controls that.
 
DoCmd.OpenReport "rptByFlightMembers", acViewPreview, , "tblPeople.HG_Flight = '" & Me.cboWhichFlight & "'"
 
Thanks, got it... just did,

Code:
 rivate Sub btnRunByFlightReport_Click()
DoCmd.OpenReport "rptByFlightMembers", acViewPreview, , "tblPeople.HG_Flight = '" & Me.cboWhichFlight & "'"

End Sub

If anyone wants to know, i just had to add the acViewPreview ...
 

Users who are viewing this thread

Back
Top Bottom