Results 1 to 3 of 3
  1. #1
    beeth is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2016
    Posts
    4

    text expressions that are parameterized by a form

    Goodmorning everyone,
    I have a very simple problem (for you) with the syntax of a query.
    I have a table with a ZIP CODE text field of 5 characters (the ZIPs are international ie a few times of 5 other than 4 characters). The extraction criteria IN ONE QUERY are through a 2-character TEXTZIP field of a FormPrint.
    I would like to extract all the ZIPs that start for those 2 characters, ie if inserting it into the form is 11 "LIKE" 11 ??? which results in all ZIPs starting with 11.

    In the criteria line I tried to insert the strings
    [code] Like "[Forms]! [FormPrint]! [ZIPCODE] ???"
    Like "[Forms]! [FormPrint]! [ZIPCODE] & ???"
    Like '[Forms]! [FormPrint]! [ZIPCODE] & ???' [/ code]

    but none of the 3 examples work (either with quotes or double quotes)

    Then there will be a problem of working on 4 and 5 characters, but I think I can get it with an OR and enter 2 or 3 interrogators.

    Something like this
    Code:
     Like "[Forms]! [FormPrint]! [ZIPCODE] ??" OR Like "[Forms]! [FormPrint]! [ZIPCODE] ???"



    Can anybody give me some indication?
    Thanks in advance

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    What is the field name in table - [Zip Code]? What is name of textbox on form - ZIPCODE?

    SELECT * FROM sometable WHERE [Zip Code] Like [Forms]![FormPrint]![ZIPCODE] & "*"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    beeth is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2016
    Posts
    4
    thank you june7

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to use parameterized query
    By kumar_3345 in forum Access
    Replies: 2
    Last Post: 06-28-2014, 09:05 AM
  2. Expressions for calculating Text fields
    By drnld in forum Access
    Replies: 4
    Last Post: 05-27-2014, 10:45 AM
  3. Filter form with parameterized query
    By wnicole in forum Access
    Replies: 3
    Last Post: 10-03-2013, 12:33 PM
  4. Issues with Text Box formats and expressions
    By AndrewsPanda in forum Reports
    Replies: 3
    Last Post: 09-28-2011, 11:32 PM
  5. Form with parameterized query
    By ngruson in forum Forms
    Replies: 3
    Last Post: 08-11-2010, 11:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums