Problem populating a list box from a table

dogdays

Active Member
Joined
Apr 28, 2008
Messages
434
Office Version
  1. 2007
win 7 32 bit, access 2003
I have a list box (lsbauthors) which I am trying to populate using a temorary table. The table has one column (tName). I have set the list box control source to tName and the row source to the table. I first delete all the table entries and then insert appropriate data. The temporary table contains 1267 rows, the data is valid. The list box shows 501 rows containing #Deleted followed by the actual data. Suggestions appreciated.

Jack
 
Jack

How and when are you creating the temporary table?

Is it not possible to use a query instead of a temporary table?
 
Upvote 0
If you have to use the temp table, make sure you requery the combo box in the On Load event of the form.
 
Upvote 0
Norie:
Using SQL I selected distinct author names from a table. Using the resultant recordset I simply INSERT into the temp table The data in the temp table is valid. Prior to doing the INSERTs I did DELETE * FROM tblName. I will look into using a query.

Bob:
The list box is only populated when the user presses a command button. The list box is used to filter by author names. I think I do not need to requery.

Jack
 
Upvote 0
JAck

Is there any need for the temporary table?

Why not use the SQL of the select distinct query as the row source of the listbox?
 
Upvote 0
Norie:
Per you suggestion I used a query, it now works. Thank you.

Jack
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top