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 / April 2008

Tip: Looking for answers? Try searching our database.

Combo Box with Updateable Value List

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
=Ray= - 18 Apr 2008 15:31 GMT
I want to have a combo box on my form that allows the user to enter data that
is not an item in the value list, and where the combo box has as its value
list, all the different values in a field. (The purpose being to minimize
entry error, as in misspellings, etc. so that a previously entered value can
be easily reentered with the same spelling, but where new values may still be
entered)

So for example, when the tables are empty, I have an empty combo box, and
you can enter whatever you want (text field). Then when you start to enter
the next record, the value you entered for the first record would appear as
an item in the combo box, but where you may also enter a new value. If the
same value is used on multiple records, it should still only appear once in
the combo box.

Is there any way I can accomplish this? If I need to do some coding, that is
fine. The database will not likely ever get exceedingly large (probably never
more than 1000 records), but I'd prefer not to use a loop with VBA to go
through all the records in generating the value list.

Thanks for any help,
Ray
Klatuu - 18 Apr 2008 19:35 GMT
This would be better accomplished with using a Table/Query row source instead
of a value list.  Then for the row source, use a query that will return one
occurance of each value currently in the form's record source.

SELECT DISTINCT [FieldName] FROM TableName ORDER BY [FieldName];

Set the combo's Limit To List property to No so you can add a new value to
the field.

The last thing to do is add the new value to the combo by requerying it use
the form's After Update event:

   Me.MyCombo.Requery

Signature

Dave Hargis, Microsoft Access MVP

> I want to have a combo box on my form that allows the user to enter data that
> is not an item in the value list, and where the combo box has as its value
[quoted text clipped - 17 lines]
> Thanks for any help,
> Ray
=Ray= - 22 Apr 2008 14:44 GMT
Thank you very much. That did exactly what I need.
Ray

> This would be better accomplished with using a Table/Query row source instead
> of a value list.  Then for the row source, use a query that will return one
[quoted text clipped - 31 lines]
> > Thanks for any help,
> > Ray
 
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.