Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Thanked 0 Times in 0 Posts

    Criteria do not function (Access 2000)

    I have a Form called FrmInventory and i want by clicking the label to open another from called FrmInventoryInExt

    and to view only those product that i have chosen in the form FrmInventory. In this form i have a control TxtProductId

    However on clicking the label i open the form indeed,but the form is not filrtered and i see all the productid numbers.

    I open the seocnd form by way of:

    Dim stDocName As String
    Dim strCriteria As String
    stDocName = "FrmInventoryInExt"
    strCriteria = "ProductID = " & Me!TxtProductID
    DoCmd.OpenForm stDocName, , , strCriteria

    To my regret obvisouly the criteria seem not to be in order since they do not function.

    I will be grateful for any help

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Melbourne, Australia
    Thanked 27 Times in 27 Posts

    Re: Criteria do not function (Access 2000)

    If the PRoductID is a text field then enclose the Me!TxtProductID field in single quotes:
    strCriteria = "ProductID = '" & Me!TxtProductID & "'"

    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts