A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

stLinkCriteria Syntax



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2010, 04:27 PM posted to microsoft.public.access.forms
Brian J[_2_]
external usenet poster
 
Posts: 7
Default stLinkCriteria Syntax

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 & "' & "'"
  #2  
Old May 4th, 2010, 04:32 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default stLinkCriteria Syntax

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 & "'"


--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Brian J" wrote in message
...
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 & "' & "'"



  #3  
Old May 4th, 2010, 04:37 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default stLinkCriteria Syntax

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 J" wrote in message
...
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 & "' & "'"



  #4  
Old May 4th, 2010, 05:03 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default stLinkCriteria Syntax

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 & "'"

--
Daryl S


"Brian J" wrote:

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 & "' & "'"

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.