[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

Why isn't form opening and showing all records

I have a 2nd form which opens from an onclick event on form 1.  But when form 2 opens it opens to create a new record instead of showing all the records asociated to the key field, "EstN".  EstN is a text field.  Here's my code.  

Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmOutpurchase"
    DoCmd.OpenForm stDocName, acNormal, , "EstN = " & Me.txtRealEstN, acFormEdit
0
SteveL13
Asked:
SteveL13
  • 2
1 Solution
 
clarkscottCommented:
DoCmd.OpenForm stDocName, acNormal, , "EstN = " & chr(34( & Me.txtRealEstN & chr(34), acFormEdit

Chr(34) = quotes.  Must put quotes around text field criteria

Scott C
0
 
clarkscottCommented:
whoops... typo

" & chr(34) & Me.txtRealEstN & chr(34),

You can also use "'"    Quote - apostrophe - Quote instead of Chr(34).

Scott C
0
 
SteveL13Author Commented:
Thanks.  Worked perfectly.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now