Help with syntax.

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

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

mattc66 via AccessMonster.com

Found it ...
For a numeric link
stLink = "[ShipID]=" & Me![ShipID]
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] & "'"
 
J

Jack Leach

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)
 
J

John W. Vinson

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"
 

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

Similar Threads

Remove Link 1
DCount Help 3
Append Data in Table from VB 1
DCount LookUp Issue 5
update query : please help! 3
How to Clear acFormAdd Filter 3
Combo Box Not In List Help 9
String Parsing for multiple numbers 4

Top