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 / November 2005

Tip: Looking for answers? Try searching our database.

combo box auto type or add

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SharonInGa - 30 Nov 2005 15:12 GMT
I have over 3500 customers in a table attached to my combo box.   The feature
that "auto types" the name is invaluable.  However, I also need the ability
to add new customers into the combo box. I loose the auto type feature when  
I set the "Limit To List" to "No". .  Is there a way to have both the "auto
type" and "Limit to List = No" features to a combo box?
OfficeDev18 - 30 Nov 2005 15:26 GMT
Hi, Sharon,

Go ahead and set the LimitToList to Yes. Then program the OnNotInList event
to allow adding of new data.

HTH

>I have over 3500 customers in a table attached to my combo box.   The feature
>that "auto types" the name is invaluable.  However, I also need the ability
>to add new customers into the combo box. I loose the auto type feature when  
>I set the "Limit To List" to "No". .  Is there a way to have both the "auto
>type" and "Limit to List = No" features to a combo box?

Signature

Sam

SharonInGa - 30 Nov 2005 17:02 GMT
Can you help me out with how to write the "onNotInList" code?

> Hi, Sharon,
>
[quoted text clipped - 8 lines]
> >I set the "Limit To List" to "No". .  Is there a way to have both the "auto
> >type" and "Limit to List = No" features to a combo box?
OfficeDev18 - 30 Nov 2005 17:19 GMT
Unfortunately I can't.

>Can you help me out with how to write the "onNotInList" code?
>
[quoted text clipped - 3 lines]
>> >I set the "Limit To List" to "No". .  Is there a way to have both the "auto
>> >type" and "Limit to List = No" features to a combo box?

Signature

Sam

AkAlan - 30 Nov 2005 20:28 GMT
This is my code for allowing a user to add to the list. Hope it helps.

Dim strMsg As String
   Dim rst As DAO.Recordset
   Dim db As DAO.Database
   
   strMsg = "'" & NewData & "' is not a " & Me.cboUnit.Column(1) & "
Callsign!"
   strMsg = strMsg & " Would you like it to be added?"
   If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, "Unknown Callsign") Then
       Response = acDataErrDisplay
   Else
       Set db = CurrentDb
       NewData = CapitalizeFirst(NewData)
       Set rst = db.OpenRecordset("tblCallsigns")
       rst.AddNew
           rst("CallSign") = NewData
           rst("UnitId") = Me.UnitId
       rst.Update
           Response = acDataErrAdded
       rst.Close
   End If
   

> I have over 3500 customers in a table attached to my combo box.   The feature
> that "auto types" the name is invaluable.  However, I also need the ability
> to add new customers into the combo box. I loose the auto type feature when  
> I set the "Limit To List" to "No". .  Is there a way to have both the "auto
> type" and "Limit to List = No" features to a combo box?
 
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.