Need help with this code

  • Thread starter Afrosheen via AccessMonster.com
  • Start date
A

Afrosheen via AccessMonster.com

Thanks for reading this. I really appreciate the help.

I have a report I'm trying to generate based on three fields. WorkPlan,
IntDue, and FinalDue. This is the code I'm trying to work with.

strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" or qryTaps.IntDue=""" & strMon & _
""" or qryTaps.FinalDue=""" & strMon"

As it stands right now, I'm getting a "Syntax Error". If the routine works it
will produce this information and look like this.

Workplan IntDue FinalDue
Joe January
Pete January
Fred January

The strMon is the month selected

This is what I'm trying to do and any help is greatfull.

Thanks
 
M

Marshall Barton

Afrosheen said:
Thanks for reading this. I really appreciate the help.

I have a report I'm trying to generate based on three fields. WorkPlan,
IntDue, and FinalDue. This is the code I'm trying to work with.

strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" or qryTaps.IntDue=""" & strMon & _
""" or qryTaps.FinalDue=""" & strMon"

As it stands right now, I'm getting a "Syntax Error". If the routine works it
will produce this information and look like this.

Workplan IntDue FinalDue
Joe January
Pete January
Fred January

The strMon is the month selected


The last quote is not correct. Try:

strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" or qryTaps.IntDue=""" & strMon & _
""" or qryTaps.FinalDue=""" & strMon & """"
 
J

Jack Leach

You didn't put the closing quotes after the last variable.

strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" or qryTaps.IntDue=""" & strMon & _
""" or qryTaps.FinalDue=""" & strMon" & """"

try that


--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
A

Afrosheen via AccessMonster.com

Thanks for the help. I had to take out the " after the last strMon.
It looks like it's working.

The next thing I have to figure out is how not to print a wrong field. For
example.

WorkPlan IntDue Final Due.
Tom January
Joe January
Mark January

I'd like it like the above.

It is showing up as:
WorkPlan IntDue Final Due.
Tom January March December
Joe April May January
Mark December January June

So there is still some work to be done.

Thanks for the help.




Jack said:
You didn't put the closing quotes after the last variable.

strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" or qryTaps.IntDue=""" & strMon & _
""" or qryTaps.FinalDue=""" & strMon" & """"

try that
Thanks for reading this. I really appreciate the help.
[quoted text clipped - 18 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Trying to look like this 8
I need help with SQL please 10
SQL Guru 3
Need help modifying code 0
Need Help with Macro Security 1
Need some PWA help 0
Here's my delema 5
Need Help with a VBA subroutine 0

Top