combo box auto type or add

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Hi, Sharon,

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

HTH
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top