Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / October 2005

Tip: Looking for answers? Try searching our database.

add new item to combobox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mcnewsxp - 20 Oct 2005 15:28 GMT
is there a way for a user to add an item to a combo box?
lets say a user doesn't find what he is looking for in the combobox and
wants to add  new item directly to the combobox.
can this be doen?

i know how to get new items into a combobox using other controls - that is
not what i  am asking.

thanks,
mcnewsxp
Klatuu - 20 Oct 2005 16:07 GMT
First you need to set the Limit To List property of the combo box to No.  
Then, it the Not In List Event, you need to do whatever you want to manage
adding the new value to the list.  How you do that depends on the Row Source
Type property.  And last, you will need to requery the combo box so the new
value will show up in the list.

> is there a way for a user to add an item to a combo box?
> lets say a user doesn't find what he is looking for in the combobox and
[quoted text clipped - 6 lines]
> thanks,
> mcnewsxp
mcnewsxp - 20 Oct 2005 16:17 GMT
> First you need to set the Limit To List property of the combo box to No.
> Then, it the Not In List Event, you need to do whatever you want to manage
[quoted text clipped - 3 lines]
> new
> value will show up in the list.

the problem i am having with that approach is it wants the bound column
(hidden ID field) to be visible which is numeric and not at all what i want
to add to the list.
know what i mean?
Klatuu - 20 Oct 2005 16:27 GMT
Is the hidden ID field an autonumber field in the row source for your combo?  
Can you give more details on the row source, like what type is it (table,
query, value list, field list)?  How are you trying to add the new value?

> > First you need to set the Limit To List property of the combo box to No.
> > Then, it the Not In List Event, you need to do whatever you want to manage
[quoted text clipped - 8 lines]
> to add to the list.
> know what i mean?
mcnewsxp - 20 Oct 2005 18:27 GMT
> Is the hidden ID field an autonumber field in the row source for your
> combo?
> Can you give more details on the row source, like what type is it (table,
> query, value list, field list)?  How are you trying to add the new value?

it's a table with an autonumber and text field.
i want to add new text and i need to be able to access the autonumber ID
field for further processing on the form.
Klatuu - 20 Oct 2005 18:46 GMT
When you create a new record with an Autonumber field, that field will be
assigned a value.  Then, when you do Me.MyComboBox.Requery, it should add all
the columns in the combo's row source. Is it not doing that?  Also, what are
you using the autonumber for processing for?  That is a bit unusual.

> > Is the hidden ID field an autonumber field in the row source for your
> > combo?
[quoted text clipped - 4 lines]
> i want to add new text and i need to be able to access the autonumber ID
> field for further processing on the form.
mcnewsxp - 20 Oct 2005 19:32 GMT
> When you create a new record with an Autonumber field, that field will be
> assigned a value.  Then, when you do Me.MyComboBox.Requery, it should add
> all
> the columns in the combo's row source. Is it not doing that?  Also, what
> are
> you using the autonumber for processing for?  That is a bit unusual.

users will be able to add to the combo that shares data with all users but
at the same time insert to a table that belongs to the current user.
Klatuu - 20 Oct 2005 19:50 GMT
That makes sense.  So have you got it working?

> > When you create a new record with an Autonumber field, that field will be
> > assigned a value.  Then, when you do Me.MyComboBox.Requery, it should add
[quoted text clipped - 5 lines]
> users will be able to add to the combo that shares data with all users but
> at the same time insert to a table that belongs to the current user.
mcnewsxp - 20 Oct 2005 20:26 GMT
> That makes sense.  So have you got it working?

not yet...

>> > When you create a new record with an Autonumber field, that field will
>> > be
[quoted text clipped - 9 lines]
>> but
>> at the same time insert to a table that belongs to the current user.
Klatuu - 20 Oct 2005 20:55 GMT
Good luck, let me know

> > That makes sense.  So have you got it working?
>
[quoted text clipped - 13 lines]
> >> but
> >> at the same time insert to a table that belongs to the current user.
MacDermott - 21 Oct 2005 02:21 GMT
Actually, LimitToList must be set to Yes to get the NotInList event to
fire...

> First you need to set the Limit To List property of the combo box to No.
> Then, it the Not In List Event, you need to do whatever you want to manage
[quoted text clipped - 12 lines]
> > thanks,
> > mcnewsxp
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.