stLinkCriteria Syntax

  • Thread starter Thread starter Brian J
  • Start date Start date
B

Brian J

I am unable to get my syntax working for my four criteria. Can anyone
suggest what is wrong?
stLinkCriteria = "[FiscalYearInd] = '" & Me.lstFiscalYear & "' _
And [UHC_DEPT_NUM] = '" & Me.Text217 & "' _
And [PROV_UHC_CAT_NUM] = '" & Me.Text219 & "' _
And [DivisionCode] = '" & Me.Text221 & "' & "'"
 
The line continuation characters cannot be inside the quotes.

stLinkCriteria = "[FiscalYearInd] = '" & Me.lstFiscalYear & "' " & _
"And [UHC_DEPT_NUM] = '" & Me.Text217 & "' " & _
"And [PROV_UHC_CAT_NUM] = '" & Me.Text219 & "' " & _
"And [DivisionCode] = '" & Me.Text221 & "'"
 
Brian

It might help to know what happens ... what do you mean by "get [it]
working"?

By the way, if your [FiscalYearInd] is stored as a numeric data type, you
wouldn't use the single quote (that's reserved for delimiting text type
data).

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Brian -

Try this - only adjusted the last quotes:

stLinkCriteria = "[FiscalYearInd] = '" & Me.lstFiscalYear & "' _
And [UHC_DEPT_NUM] = '" & Me.Text217 & "' _
And [PROV_UHC_CAT_NUM] = '" & Me.Text219 & "' _
And [DivisionCode] = '" & Me.Text221 & "'"
 

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

Back
Top