Results 1 to 2 of 2
  1. #1
    Moonman is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    8

    Cool Entering Data into Textbox as Search Criteria

    I have a simple form with four fields, one of which being "WO." I would like the user to input a given 6 digit number (search: any part of field) and click a button, and the remaining 3 fields would be populated with the associated record data. If the 6 digit number does not exist or the textbox is blank, I would like an msgbox to indicate so. I would like to understand how this done in vba to get me away from using the standard find/search dialog boxes and provide me more flexibility as a programmer. I have searched the threads, but as a novice, most threads seemed beyond my understanding. Any help would be greatly appreciated.



    Thanks so much,

    Moonman

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Is WO the foreign key and you need to view related info from the lookup table? Options that don't require VBA:

    1. include the lookup table in the form RecordSource, bind textboxes to the related info fields and set them as Locked Yes, TabStop No

    2. make WO a multi-column combobox, then textboxes refer to columns of the combobox

    3. DLookup() in textbox ControlSource expression

    Otherwise, if what you want is to input a parameter and filter the form's records, options:

    1. parameterized query, review http://datapigtechnologies.com/flash...tomfilter.html

    2. VBA to build criteria string and set form Filter and FilterOn properties, review http://allenbrowne.com/ser-62code.html
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-08-2013, 02:54 PM
  2. Replies: 3
    Last Post: 07-25-2013, 05:19 PM
  3. Replies: 4
    Last Post: 06-10-2013, 08:01 AM
  4. Replies: 8
    Last Post: 04-12-2013, 08:59 PM
  5. Entering Criteria in a Query
    By wdrspens in forum Queries
    Replies: 4
    Last Post: 04-13-2011, 04:44 PM

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