stLinkCriteria Help

I

Irene

i have a form which have "material code" and "DOno". this two field are text.
in this form i want when click the button and it will open another form. but
it is link with this two two field. how i write the code in the
stLinkCriteria. I have try many times, but stil cant get the right. hope
somebody can help me. i have type it like this:

stLinkCriteria = "[matl_code]=" & "'" & Me![matl_code] & "'" And " [DO_no]="
& "'" & Me![DO_no] & "'"

anything wrong? thanks for the help!
 
R

rm

One thing to try... (I do not have an instance of access available so
I cannot debug this right now)...
stLinkCriteria = "[matl_code]=" & chr(34) & Me![matl_code] & chr(34) &
" And [DO_no]=" & chr(34) & Me![DO_no] & chr(34) & chr(34)

Hey is DO_no a number or text?

Something like that. I don't have an Ascii character code list
available to me right now but I think 34 is the single quote.

Use a break point and the immediate or locals window to evaluate the
value of stLinkCriteria as you pass by the line to examine the value
of the variable.

Good luck
 
R

Rui

A quick look reveals an error with the AND keyword which is not inside a
string.
Also, you have too many quotes, which is fine but makes it harder to read.

Try

stLinkCriteria = "[matl_code]='" & Me![matl_code] & _
"' And [DO_no]='" & Me![DO_no] & "'"


Rui
 

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

Top