Adding Between to stLinkCriteria

hello,

I just can't seem to get the syntex right for adding "Between" to link criteria when opening my report:

stLinkCriteria1 = "[ActualDate]=#" & Me![DateChecked] & "# And [EntryPoint]='" & Me![EntryPoint] & "' And [Background]='" & Me![Form1] & "'"

Open in new window


I want to add:

Between EntryPoint AND EntryPoint1  (a date range)
Ernest GroggAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
try

stLinkCriteria1 = "[ActualDate]=#" & Me![DateChecked] & "# And [EntryPoint] >=#" & Me![EntryPoint] & "# And [EntryPoint] <=#" & Me![EntryPoint1] & "# And [Background]='" & Me![Form1] & "'"
0
PatHartmanCommented:
stLinkCriteria1 = "ActualDate = #" & Me.DateChecked & "# And EntryPoint Between #" & Me.EntryPoint & "# AND #" & Me.EntryPoint1 & "# And [Background] = '" & Me.Form1 & "'"

You were using ' instead of # around EntryPoint.  Dates require the #.  I also removed the noise square brackets.  They aren't necessary unless your controls contain non-standard characters.  I left them around Background since that could be a reserved word.
0
Ernest GroggAuthor Commented:
sorry, I changed this a bit....so still a syntex error...I used a field that wasn't a Date field by accident...

        stLinkCriteria = "[ActualDate]=#" & Me![DateChecked] & "# And [DateChecked] >=#" & Me![DateChecked] & "# And [DateChecked] <=#" & Me![DateChecked1] & "# And [EntryPoint]='" & Me![EntryPoint] & " And [Background]='" & Me![Form1] & "'"

Open in new window

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Rey Obrero (Capricorn1)Commented:
if entrypoint is NUMBER

 stLinkCriteria = "[ActualDate]=#" & Me![DateChecked] & "# And [DateChecked] >=#" & Me![DateChecked] & "# And [DateChecked] <=#" & Me![DateChecked1] & "# And [EntryPoint]=" & Me![EntryPoint] & " And [Background]='" & Me![Form1] & "'"
                                         
if entrypoint is TEXT

 stLinkCriteria = "[ActualDate]=#" & Me![DateChecked] & "# And [DateChecked] >=#" & Me![DateChecked] & "# And [DateChecked] <=#" & Me![DateChecked1] & "# And [EntryPoint]='" & Me![EntryPoint] & "' And [Background]='" & Me![Form1] & "'"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PatHartmanCommented:
You are missing an ending ' in this part of the expression.

& Me![EntryPoint] & " And [Background]='"

should be

& Me![EntryPoint] & "' And [Background]='"

If you print stCriteria to the Immediate window after you populate it, it will be much easier for you to see where the error is.
0
Ernest GroggAuthor Commented:
Gotcha Pat!  Thanks Rey!

Works fantastically!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.