Adding new item in a drop down list from a table (1 Viewer)

jms3257

Member
Local time
Today, 05:31
Joined
Apr 18, 2020
Messages
33
Is it possible to add or edit information in a drop down list within a table. Example I have a table for cities, while entering information in a table I need to add a new city. do I need to open the city table and add, or can I add it to the table I am entering data in? I have found what change to make within a form, but nothing within a table

Thank You
Jim
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:31
Joined
Oct 29, 2018
Messages
21,454
Hi Jim. Check out either the Not In List event or the List Items Edit Form property.
 

jms3257

Member
Local time
Today, 05:31
Joined
Apr 18, 2020
Messages
33
Hi Jim. Check out either the Not In List event or the List Items Edit Form property.
Thank you, but that is still within the form not the table. I have just found out that I shouldn't be using a drop down within the table but to add it to the form. That is the problem I'm running into, I know just enough to be a danger.

Jim
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:31
Joined
Oct 29, 2018
Messages
21,454
Thank you, but that is still within the form not the table. I have just found out that I shouldn't be using a drop down within the table but to add it to the form. That is the problem I'm running into, I know just enough to be a danger.

Jim
Hi Jim. To add to that, you shouldn't be making data entry/changes at the table level. You should always try to use a Form (especially for your users; otherwise, it could get dangerous).
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:31
Joined
Feb 28, 2001
Messages
27,140
First, if your dropdown list is dynamic (i.e. changeable) then you should base a form's dropdown on a secondary table that lists the options you want to display. Adding or editing or removing an option is a matter of adding, editing, or dropping a record in the table. And if you never show your users the navigation pane or any other internal DB structures, they won't be able to screw it up for you because they won't see this table of choices.

Second, as a stop-gap measure, there is a property for combo boxes where you listed the values it could display. Those values are enumerated in a string property that is not difficult to find. There are two related properties - .RowSourceType and .RowSource - that control what your list looks like.

IF you have a short static list, you can have a "Value List" for the row source type and if so, the actual list is in .RowSource as a complex string. If you have a value list, you alter the list by editing the .RowSource string. You should be aware that using this way to specify your list is limited in size, which is why you do better to make your combo boxes depend on tables or queries.

If on the other hand you have a query or table set aside, you put "Table/Query" as the row source type and then specify the actual query OR the name of the actual query.

Here is a link to explain it a little better, perhaps.

 

Users who are viewing this thread

Top Bottom