Results 1 to 7 of 7
  1. #1
    bbmak is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    15

    How do I populate a form using query result?

    I have created a search query that allow users to search existed record in database.


    The query work completely fine, and it gives me the data that I want when I fill in my criteria. However, the query result is not showed in a form, but show in a query window.

    The form is like that
    Company (drop down with a list of company)
    Employee (drop down with a list of employee)
    Program (drop down with a list of program)
    Others (some other fields)
    ...
    Go Query (a button)

    How do I pass the query result into a form that I made? So the users can edit and update the record.

  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,625
    Reference the query in the form RecordSource.

    Review: http://www.datapigtechnologies.com/f...tomfilter.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
    bbmak is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    15
    I watched the video, but I still confuse on how to link my search form and populated form together.
    anything to do in the "Go Query Button" to link them?
    Sorry, I am a newbie on Access.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    One form can be used for search and display.

    Is your query a dynamic parameterized (criteria references form controls for input)?

    Set the RecordSource of the 'search' form to the query.

    Create textboxes on the search form and bind them to fields.

    Instead of code to open query, have code to requery the form.

    The video demonstrates the above.

    Or create a report that uses the query as RecordSource. Then code would open the report instead query.
    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.

  5. #5
    bbmak is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    15
    Thank I got it.
    Is that also apply to a subform as well? I can pass the strings into a subform?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Yes, a subform is just a form. Actually, it is a subform/subreport container control that holds an object. That object can be a table, query, form, report.
    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.

  7. #7
    bbmak is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    15
    thank you so much

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

Similar Threads

  1. Replies: 2
    Last Post: 11-27-2013, 05:24 PM
  2. Populate Field when result is Null
    By BarneyH4 in forum Queries
    Replies: 3
    Last Post: 06-25-2013, 11:03 AM
  3. Replies: 3
    Last Post: 04-30-2013, 12:01 AM
  4. Replies: 12
    Last Post: 06-25-2012, 01:42 PM
  5. Replies: 1
    Last Post: 06-09-2012, 05: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