View Full Version : Value list problem


TomBP
07-07-2006, 02:41 AM
I'm making use of a value list to add firms in a column. Now I would like to try something out. Suppose there is another firm that isn'nt in the value list. I selected no for the Limit To List question.

http://i54.photobucket.com/albums/g115/TomBP/Pic1-5.jpg

This makes it possible to type a firm in the firm column that is not in the list. I typed "CargoTex" as example.

http://i54.photobucket.com/albums/g115/TomBP/Pic2-4.jpg

The problem I have is that "Cargotex" isn't featured in the list after I typed it in record 24. How can I make it possible that when I add a different firm to the firm column, it will be shown in the value list for the next time. A bonus feature would be that the word would be alpabethically organised within the list.

mhartman
07-07-2006, 06:22 AM
Hello:

You would use the "On not in list" event to handle this. Then you can programically add the selection to the list or do some other routine.
Regards
Mark

Banana
07-07-2006, 06:28 AM
Besides, it will be much easier if instead of using a value list, you use a table to lookup the value. A lookup table can be easily modified with less work than with a value list.

Value list is good for short list that will never change practically forever (e.g. Gender= Male, Female). Entities such as firm name, customers, invoices type, should go to a lookup table.

Matt Greatorex
07-07-2006, 06:34 AM
Alternatively, set Limit to List to 'No', as you have, and add the following in the After Update event of the listbox:

[Forms]![formname]![fieldname].Requery

This will rerun the query providing the data for the field, ensuring that the value can be used straight away.

TomBP
07-10-2006, 01:01 AM
Where can I acces the after update event cause I can't seem to find it.

http://i54.photobucket.com/albums/g115/TomBP/valuelistafterupdate.jpg

Is it somewhere here I have to look?

Rich
07-10-2006, 01:31 AM
There are no events associated with data entry directly into tables which is why you should be using forms to enter data.

TomBP
07-10-2006, 04:14 AM
I have tried this:

[Forms]![formname]![fieldname].Requery

But it doesn't seem to do the trick