P
Pamela
How can I have the items that are added to my combo box add to the list in
alphebetical order? I currently have it coded to be able to add item on
NotInList event but the item is added to the end of the list. Here is the
code I have now:
Private Sub cboInsuranceCoID_NotInList(NewData As String, Response As Integer)
If MsgBox(NewData & " is not in the list." & vbCrLf & "Would you like to
add" & NewData & "?", vbQuestion + _
vbYesNo + vbDefaultButton2, "Not Found") = vbYes Then
Me.cboInsuranceCoID.Undo
DoCmd.OpenForm "frm_ClientCo", , , , acFormAdd, acDialog
Response = acDataErrAdded
Me.Requery
With Me.RecordsetClone
.FindFirst [InsuranceCoID] = " & NewData & """
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Else
Me.cboInsuranceCoID.Undo
Response = acDataErrContinue
End If
End Sub
Thanks so much for any help with this!
alphebetical order? I currently have it coded to be able to add item on
NotInList event but the item is added to the end of the list. Here is the
code I have now:
Private Sub cboInsuranceCoID_NotInList(NewData As String, Response As Integer)
If MsgBox(NewData & " is not in the list." & vbCrLf & "Would you like to
add" & NewData & "?", vbQuestion + _
vbYesNo + vbDefaultButton2, "Not Found") = vbYes Then
Me.cboInsuranceCoID.Undo
DoCmd.OpenForm "frm_ClientCo", , , , acFormAdd, acDialog
Response = acDataErrAdded
Me.Requery
With Me.RecordsetClone
.FindFirst [InsuranceCoID] = " & NewData & """
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Else
Me.cboInsuranceCoID.Undo
Response = acDataErrContinue
End If
End Sub
Thanks so much for any help with this!