Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form 1

Status
Not open for further replies.

HILLAR

Programmer
Mar 10, 2004
6
US
I am trying to open a form using two criterias. I am getting type mismatch which means I am obviously doing something wrong. Please help!!! This is the code that I have:

DoCmd.OpenForm "F-Duplicate record search", , , ("[rel#] = '" & strinput & "'" Or "[secondrelno] = '" & strinput & "'")

The strinput is value of an input box.

Thanks.

 
Hello,

I might be getting confused here but the field REL# seems to indicate it is a numeric field of some kind, in which case you wouldn't need the single quotes round it.

Andrew

 
Use this for reference:

FORMTYPE = acFormDS
stLinkCriteria = "[parent]=" & "'" & [PTNR] & "'" & " and [PARENTREV]=" & "'" & [REV] & "'"
DoCmd.OpenForm "BOM", FORMTYPE, , stLinkCriteria

Good luck,
Kuzz

"Time spent debating the impossible subtracts from the time during which you
can try to accomplish it."
 
No actually, when rel# was originally created (not by me) the data type was assigned as text.
Thanks.
 
Try

DoCmd.OpenForm "F-Duplicate record search", , , ("[rel#] = '" & strinput & "' Or [secondrelno] = '" & strinput & "'")

DoCmd.OpenForm "F-Duplicate record search", , , ("[rel#] = '" & strinput & "'[red]"[/red] Or [red]"[/red][secondrelno] = '" & strinput & "'")


Bill
 
Thank you Kuzz. It worked. You guys are quick and helpful.
Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top