Quick Link Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Trying to set link on two fields. I tried teh following but doesn't work. I
belive syntax is wrong?

stLinkCriteria = "[IDSupplier]=" And [IDPartNo]
= " & Me![IDSupplier] And Me![IDPartNo]"
 
stLinkCriteria = "[IDSupplier]=" & Me![IDSupplier]
& " And [IDPartNo]=" & Me![IDPartNo]

This assumes that both IDSupplier and IDPartNo are numeric. If they're text,
you need to put quotes around the values:

stLinkCriteria = "[IDSupplier]='" & Me![IDSupplier]
& "' And [IDPartNo]='" & Me![IDPartNo] & "'"

Exagerated for clarity, that's


stLinkCriteria = "[IDSupplier]= ' " & Me![IDSupplier]
& " ' And [IDPartNo]= ' " & Me![IDPartNo] & " ' "
 
Thanks Doug! Appreciate it!

Douglas J. Steele said:
stLinkCriteria = "[IDSupplier]=" & Me![IDSupplier]
& " And [IDPartNo]=" & Me![IDPartNo]

This assumes that both IDSupplier and IDPartNo are numeric. If they're text,
you need to put quotes around the values:

stLinkCriteria = "[IDSupplier]='" & Me![IDSupplier]
& "' And [IDPartNo]='" & Me![IDPartNo] & "'"

Exagerated for clarity, that's


stLinkCriteria = "[IDSupplier]= ' " & Me![IDSupplier]
& " ' And [IDPartNo]= ' " & Me![IDPartNo] & " ' "

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



MBoozer said:
Trying to set link on two fields. I tried teh following but doesn't work.
I
belive syntax is wrong?

stLinkCriteria = "[IDSupplier]=" And [IDPartNo]
= " & Me![IDSupplier] And Me![IDPartNo]"
 
Back
Top