Solved

Populate listbox from query using vba

Posted on 2009-05-19
4
727 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
  • 3
4 Comments
 
LVL 3

Expert Comment

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

Accepted Solution

by:
jakemdrew earned 500 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now