Open form, text data type

pdvsa
pdvsa used Ask the Experts™
on
Experts,

I am trying to open a form to the criteria below.
The [LCNo] is text data type.
I believe I need some combination of single quotes and double quotes as it is text data type and not a number but the order and placement of the quotes is what I need help with.  

thank you

Private Sub LCNo_Click()

        DoCmd.OpenForm "frmLetterOfCreditAdd", , , "[LCNo]=" & Me!LCNo

End Sub
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
mbizupNerd
Most Valuable Expert 2012
Top Expert 2013

Commented:
Your criteria should look like this :

"LCNo = '" &
Nerd
Most Valuable Expert 2012
Top Expert 2013
Commented:
Sorry ...

"LCNo = '" & ME!LCNo & "'"
Top Expert 2016

Commented:
DoCmd.OpenForm "frmLetterOfCreditAdd", , , "[LCNo]='" & Me!LCNo & "'"

exploded view


DoCmd.OpenForm "frmLetterOfCreditAdd", , , "[LCNo]= ' " & Me.LCNo & " ' "

or you can use this

DoCmd.OpenForm "frmLetterOfCreditAdd", , , "[LCNo]=" & chr(34) & Me.LCNo & chr(34)
pdvsaProject finance

Author

Commented:
glad you came back quick because I scratching my head on that.   thank you. it worked perfectly!
mbizupNerd
Most Valuable Expert 2012
Top Expert 2013

Commented:
:-)

I'll blame my cellphone for that first post.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial