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?