Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    Tasmania
    Posts
    58

    Unanswered: using textbox value in criteria for list box

    I'm opening a form from another form & wanting to use value from list box on original form as part of criteria for populating list box on 2nd form. In open form event I can get value from 1st form ok, & I put this into text box on 2nd form. But, am having trouble accessing this value in the sql for the list box.
    SELECT ItemDesc FROM tblItem
    WHERE (CompanyUniq = [Forms].[frmItemSearch]![txtCompanyUniq])
    gives error.

    I also tried a global function to return the value I want which I remember using in an earlier version of Access to handle similar problem - & the query designer rejected the unknown function.

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: using textbox value in criteria for list box

    Originally posted by Colin Atkins
    I'm opening a form from another form & wanting to use value from list box on original form as part of criteria for populating list box on 2nd form. In open form event I can get value from 1st form ok, & I put this into text box on 2nd form. But, am having trouble accessing this value in the sql for the list box.
    SELECT ItemDesc FROM tblItem
    WHERE (CompanyUniq = [Forms].[frmItemSearch]![txtCompanyUniq])
    gives error.

    I also tried a global function to return the value I want which I remember using in an earlier version of Access to handle similar problem - & the query designer rejected the unknown function.
    In case that txtCompanyUniq is Numeric
    did you try
    "SELECT whatever FROM yourTable WHERE CompanyUniq = " & _
    [Forms]![frmItemSearch]![txtCompanyUniq] & ";"

Posting Permissions

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