lookup table with a default selected row

O

OrdinarySoul

Hi,

I am currently using a lookup table to populate the values in a
listbox.

columns:
item_id number
item_name text

values:
item_id item_name
1 item_A
2 item_B
3 item_C
.....
With item_A being the default that's automatically selected when the
listbox displays.

Now I've added the feature to allow users to update which item they
want to use as the default. So I need to track the default value in
the database. There are two options I can think of:

1. Add a column to the table indicating if a row is the default
value:
item_id number
item_name text
default boolean

This option could work, but waste some unnecessary space.

2. Use a table with only one field, one row to store the default
value:
Table default_item:
item_id number

This option would not take up a lot of space, but the query for the
listbox would be more complicated, with a join.


So, can anyone think of any other options that might be simpler,
faster, easier to implement? Thank you very much for your ideas.
 
G

Guest

You could during the open event on the form do a dlookup for the default
value and set the listbox to that value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top