Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add records to a listbox

Status
Not open for further replies.

clientuser

Programmer
Apr 18, 2001
296
US
how do I add records that I have looked up to a listbox? Im assuming a recordset would have to be made and then updated to the listbox?
 
You should put your query into the ListBox.RecordSource property.
 
The problem is when I do that, I have one field that ask for criteria and when I put it in, it then prompts me for it again, I only have the query referenced in the listbox and no where else on the form..

any suggestions?
 
Hey, I had the same problem on a project I did a few weeks ago.. describe your situation a little more an I'll see if my solution fits yours. Let me know what your SQL statement is and what your needing the listbox to do. -Dustin
Rom 8:28
 
Hi!
You may requery listbox data:
me.lstBox.requery

or set new rowsource:

Example:

dim strSQL as string

strSQL="Select * From MyTable Where MyField = " & me.MyCriteria
me.lstBox.rowsource=strSQL

Aivars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top