L
likeyeah
I have a form that prints a report using a two combo buttons to select criteria.
One is a week number in the form 1151,1152 etc. and the other will deliver a string dependent on the section.
So for exampe using stlinkcriteria I will filter the report on Week 1152 for WTS(M)
The M represents Mechanical, I use an E for Electrical.
When I pass the parameters using :
stlinkcriteria = "[ForecastWeek]=" & Me!fcweektxt & " AND [SectionFull] = " & Me![plnwksectresptxt]
Which are the two combo box selections fed into text boxes fcweektxt and plnwksectresptxt using the "Msgbox
stlinkcriteria" command within the event code I get:
[ForecastWeek]=1151 AND [SectionFull]=WTS(M)
So it is passing the required parameter to the query. However, when you use anything with brackets in a query, it
sees it as a function, so even in direct mode if you type WTS(M) into the criteria field, Access automatically
makes it WTS("M") so you have to edit it manually to make it
"WTS(M)"
Can anyone point me to the right syntax in the stlinkcriteria statement to send the WTS(M) criteria to the
underlying query of the report in the correct way to get parsed properly. I presume it is around using ' and "
correctly to get the data into the query. Or in fact is this not possible due to the way access queries treat
brackets?
Thanks
J
One is a week number in the form 1151,1152 etc. and the other will deliver a string dependent on the section.
So for exampe using stlinkcriteria I will filter the report on Week 1152 for WTS(M)
The M represents Mechanical, I use an E for Electrical.
When I pass the parameters using :
stlinkcriteria = "[ForecastWeek]=" & Me!fcweektxt & " AND [SectionFull] = " & Me![plnwksectresptxt]
Which are the two combo box selections fed into text boxes fcweektxt and plnwksectresptxt using the "Msgbox
stlinkcriteria" command within the event code I get:
[ForecastWeek]=1151 AND [SectionFull]=WTS(M)
So it is passing the required parameter to the query. However, when you use anything with brackets in a query, it
sees it as a function, so even in direct mode if you type WTS(M) into the criteria field, Access automatically
makes it WTS("M") so you have to edit it manually to make it
"WTS(M)"
Can anyone point me to the right syntax in the stlinkcriteria statement to send the WTS(M) criteria to the
underlying query of the report in the correct way to get parsed properly. I presume it is around using ' and "
correctly to get the data into the query. Or in fact is this not possible due to the way access queries treat
brackets?
Thanks
J