?
Solved

Populate listbox from query using vba

Posted on 2009-05-19
4
Medium Priority
?
755 Views
Last Modified: 2012-06-21
Hi,
I have a form with a listbox (not visible). I would like to use a cmd button to make the listbox visible, then populate the list box with the results from a query.
The listbox name is lstJobSearch and the query is qryFindCompayJobsSearch.
The query asks for the Company perameters for the search.
Can u give me some guidlines on vba code. I am ok with the visible etc., but I don't know how to populate the listbox on demand, using the query (or similar method)
0
Comment
Question by:jwjjwj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 3

Expert Comment

by:jakemdrew
ID: 24428168
lstJobSearch. recordsource = qryFindCompayJobsSearch
0
 
LVL 3

Accepted Solution

by:
jakemdrew earned 2000 total points
ID: 24428179
Sorry, it is the rowsource property.

lstJobSearch.rowsource = qryFindCompayJobsSearch
0
 
LVL 3

Expert Comment

by:jakemdrew
ID: 24428185
If you need to refresh the contents of the listbox:

lstJobSearch.Requery
0
 

Author Closing Comment

by:jwjjwj
ID: 31583328
Thanks jakemdrew, worked like a dream. Had to put " around the query name.
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question