Adding Between to stLinkCriteria


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 GroggSecurity Management InfoSecAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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:

stLinkCriteria1 = "[ActualDate]=#" & Me![DateChecked] & "# And [EntryPoint] >=#" & Me![EntryPoint] & "# And [EntryPoint] <=#" & Me![EntryPoint1] & "# And [Background]='" & Me![Form1] & "'"
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.
Ernest GroggSecurity Management InfoSecAuthor Commented:
sorry, I changed this a 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

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook 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] & "'"

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
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.
Ernest GroggSecurity Management InfoSecAuthor Commented:
Gotcha Pat!  Thanks Rey!

Works fantastically!
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.