Open Report based on Form

steve711

Registered User.
Local time
Today, 10:53
Joined
Mar 25, 2004
Messages
166
I have a query that lists a SalesPersons information for the month.

Date of Sale (MONTH YEAR)
Date of Goals (MONTH YEAR) we set this at the beginning of the month
Date of UPPS (MONTH YEAR) total of customer visits he has done for the month

I have a form that allows me to search through my salesman and double click his name and MONTH YEAR. I cannot seem to get this to work or maybe there is a better way to make this fire that my noobness isn't seeing.

DoCmd.OpenReport "rptSoldGoals", acViewPreview, , "[SalesPerson] = """ & Me.lstPilot & """ and [DateOfSale] = #" & lstPilot.Column(1) & "# "" and [Date_objective] = #" & lstPilot.Column(1) & "# "" and [UPPSDate] = #" & lst.Pilot.Column(1) & "#"


I'm have a hard time with the "#" ' " drives me nuts. Any help or do I need to provide more information?

It may be that my query is whacked and I need to rework it but let's see what you all say.

Thanks.
 
For chuckles, try this:

DoCmd.OpenReport "rptSoldGoals", acViewPreview, , "[SalesPerson] = '" & Me.lstPilot & "' and [DateOfSale] = #" & Me.lstPilot.Column(1) & "# and [Date_objective] = #" & Me.lstPilot.Column(1) & "# and [UPPSDate] = #" & Me.lstPilot.Column(1) & "#"

You understand that all the date fields are pointed at the same column? It also seems odd that the date parameter is in the same listbox as the salesperson.
 

Users who are viewing this thread

Back
Top Bottom