Results 1 to 6 of 6
  1. #1
    gentrym is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    3

    Trying to use a form to return multiple fields from a query

    I have already made a query with all the information needed. What I am trying to do is create a form where a user can open the database and enter a unique number and have information from 10 fields associated with that number show. And here's the kicker (if you couldn't tell by how I posed the question), I'm quite the novice at Access and don't really know all the coding techniques you guys do. I'm sure I did a bad job explaining my issue, but I am lost on this one. Any help would be appreciated.

  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
    52,919
    Build a form with an UNBOUND control (textbox or combobox) for user to input/select this unique number. This form can be set to open by default when the db opens.

    Options to filter records:

    1. dynamic parameterized query that references the control as input parameter

    2. apply that input value as filter criteria for another form or report - pass the value to the form/report when it opens

    DoCmd.OpenForm "form name", , , "ID=" & Me.controlname

    3. have the default form bound to the data and the criteria control in the form header, use parameterized query as form RecordSource or use code to set form Filter and FilterOn properties 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.

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    No, the question makes sense. One way would be to use a Combo Box with a list of as you say unique id's. Then using the AfterUpdateEvent, populate your fields with the values.
    Me.SomeField =[MyComboBoxName].Column(X) 'Remember it starts as 0

  4. #4
    gentrym is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    3
    Thanks for the responses. I'll play around with what you guys said (although some of it is greek to me).

  5. #5
    gentrym is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    3
    Ok, I quickly found out I have no idea how to do what you guys are talking about. I understand the big picture, but have no idea how to actually do it. Is there any way to explain it easier terms? Or do it without VBA codes or whatever?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Examples of using dynamic parameterized query:

    http://www.datapigtechnologies.com/f...mtoreport.html
    http://www.datapigtechnologies.com/f...earchform.html
    http://www.datapigtechnologies.com/f...tomfilter.html

    Those examples are all for text data type fields and use the LIKE operator with wildcard. LIKE and wildcard doesn't work with number or date/time type fields. Just use = operator in the parameter for the unique identifier field.
    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. Using Multiple Fields in Form to Generate Query
    By crawfish124 in forum Forms
    Replies: 4
    Last Post: 06-04-2014, 10:39 AM
  2. Replies: 11
    Last Post: 04-15-2013, 11:58 AM
  3. Replies: 2
    Last Post: 08-05-2011, 01:24 PM
  4. Form Based Query for Multiple Fields
    By sureelsaraf in forum Access
    Replies: 0
    Last Post: 03-28-2011, 06:14 PM
  5. Replies: 11
    Last Post: 09-02-2010, 01:59 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