Search Form

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

Guest

Hello,
I am working on a Search Form that utilizes 2 texts boxes (Text9 and Text11)
to look up the respective fields "Symbol" and "SerialNo" on my "Items" table
and open a separate Form (Form1) with the history of the "Item". I want to
enter both numbers so that it can locate that specific item. I was able to
make only one text box work, but I have not been able to make both of them
work.

I am using the following code, but I can't seem to make it work I get a
syntax error (missing operator) message.

stDocName = "Form1"
stLinkCriteria = "[Symbol]=" & "'" & Me![Text9] & "[SerialNo]=" & "'" &
Me![Text11]
DoCmd.OpenForm stDocName, , , stLinkCriteria

I have also tried to use "=" and "&&" and "+" to substitute the "&" after
"Me![Text9]" but either nothing happens or I get a mismatch type.

What am I doing wrong? Please help.

Thank you in advance.

JRG
 
I found the answer to my problem thank you. The following code was the
solution to my problem:

stLinkCriteria = "[Symbol]=" & "'" & Me![Text9] & "'"
stLinkCriteria = stLinkCriteria & " AND [SerialNo]=" & "'" & Me![Text11] & "'"

I was on the right path but I was missing the stLinkCriteria =
stLinkCriteria. =D


JRG
 
Back
Top