Add a value to drop down list?

J

jackmac

Hi all,

I have a form which has a drop-down box for users to select a value (doors,
windows, conservatories etc). In the database I used the lookup wizard to
create the list as this was an easy solution. I have put a startup form as
the user interface and I want to put a button on there for users to add new
values to the drop-down list. Anyone any idea how to do this?

TIA

Jack
 
J

John W. Vinson

Hi all,

I have a form which has a drop-down box for users to select a value (doors,
windows, conservatories etc). In the database I used the lookup wizard to
create the list as this was an easy solution. I have put a startup form as
the user interface and I want to put a button on there for users to add new
values to the drop-down list. Anyone any idea how to do this?

TIA

Jack

That's one of the (many!) problems with the lookup wizard. It conceals what
you're actually doing!

Open the form in design view. Select the combo box. View its Properties.

What is the RowSourceType? What is the RowSource?

The type should be "Table/Query" and the rowsource should be the name of the
lookup table that the wizard created. If so, you just need to add a record to
this table (have your button open a simple form based on the table).

If that's not the case post back with the row source info.
 
J

jackmac

John W. Vinson said:
That's one of the (many!) problems with the lookup wizard. It conceals
what
you're actually doing!

Open the form in design view. Select the combo box. View its Properties.

What is the RowSourceType? What is the RowSource?

The type should be "Table/Query" and the rowsource should be the name of
the
lookup table that the wizard created. If so, you just need to add a record
to
this table (have your button open a simple form based on the table).

If that's not the case post back with the row source info.

As I added it via the lookup wizard it created it as a 'Value List'. Is
there any way I can code a button to add to this Value List?

Would it be easier if I created another table with one field and used the
values as the drop-down?

TIA

Jack
 
J

John W. Vinson

As I added it via the lookup wizard it created it as a 'Value List'. Is
there any way I can code a button to add to this Value List?

Only with some complicated and snarky VBA code (it would have to find all of
the instances of this combo). Value List combos are useful only when the list
is small and static (e.g. "Mr.";"Mrs.";"Ms.";"Miss")
Would it be easier if I created another table with one field and used the
values as the drop-down?

Yes.
 
J

jackmac

John W. Vinson said:
Only with some complicated and snarky VBA code (it would have to find all
of
the instances of this combo). Value List combos are useful only when the
list
is small and static (e.g. "Mr.";"Mrs.";"Ms.";"Miss")


Yes.

Sounds good. Thanks for the advice, will create a new table and go from
there.

Thanks for the help John! Much appreciated.
 

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