From: mattc66 via AccessMonster.com on
I cant remember the syntax is the data is a number. Below is if the data is
text.
I wish this site kept my older posts I know I have asked this before.

stLink = "[OrderNum]=" & "'" & Me![OrderNum] & "'"

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1

From: mattc66 via AccessMonster.com on
Found it ...
For a numeric link
stLink = "[ShipID]=" & Me![ShipID]

mattc66 wrote:
>I cant remember the syntax is the data is a number. Below is if the data is
>text.
>I wish this site kept my older posts I know I have asked this before.
>
>stLink = "[OrderNum]=" & "'" & Me![OrderNum] & "'"
>

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via http://www.accessmonster.com

From: Jack Leach dymondjack at hot mail dot on
Numeric: (no quotes around value)

stLink = "[field] = " & Me![field]



String/Text: (quotes around value)

stLink = "[field] = """ & Me![field] & """"



Dates: (#'s around value)

stLink = "[field] = #" & Me.[field] & "#"


hth
--
Jack Leach
www.tristatemachine.com

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



"mattc66 via AccessMonster.com" wrote:

> I cant remember the syntax is the data is a number. Below is if the data is
> text.
> I wish this site kept my older posts I know I have asked this before.
>
> stLink = "[OrderNum]=" & "'" & Me![OrderNum] & "'"
>
> --
> Matt Campbell
> mattc (at) saunatec [dot] com
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1
>
> .
>
From: John W. Vinson on
On Tue, 09 Mar 2010 16:20:35 GMT, "mattc66 via AccessMonster.com" <u16013(a)uwe>
wrote:

>I cant remember the syntax is the data is a number. Below is if the data is
>text.
>I wish this site kept my older posts I know I have asked this before.
>
>stLink = "[OrderNum]=" & "'" & Me![OrderNum] & "'"

Just lose the extra quotes.

Date/Time fields must use # as a delimiter.
Text fields can use either " or ' as a delimiter.
Number and Currency fields use no delimiter at all.

stLink = "[OrderNum] = " & Me![OrderNum]

will work.

Note that you don't have to break out the leading ' delimiter for text fields;
it's just a character in the " delimited string constant, like = or ] or any
other character. You could (for text fields) use

stLink = "[OrderNum] = '" & Me![OrderNum] & "'"

Note also that if the string you're using might contain an apostrophe, you
shouldn't use ' as a delimiter since the apostrophe will be seen as a
premature closing quote. You can use " in a string by doubling it up - two
consecutive doublequotes in a doublequote delimited string will be translated
to a single doublequote (yes, I know, doubletalk):

stLink = "[LastName] = """ & Me!txtLastName & """"

will allow for a construct like

[LastName] = "O'Reilly"

--

John W. Vinson [MVP]