S
Steven
I have a bound cbo (to ASECContact) with many entries. I
would like to have these entries listed in alphabetical
order. I have tried :
Private Sub Combo137_AfterUpdate()
Dim FilterString As String
FilterString = "ASECContact = """ & Me.Combo137 & """"
DoCmd.ApplyFilter , FilterString
End Sub
but this does not work? I also have the following code on
this cbo. which allows me to enter new information:
Private Sub Combo137_NotInList(NewData As String,
Response As Integer)
Dim db As Database
Set db = CurrentDb
'Ask the user if they want to add to the list
If MsgBox("Do you want to add this entity to the list?",
vbYesNo + vbQuestion, "Add new value?") = vbYes Then
'The user clicked Yes - add the new value
db.Execute "INSERT INTO tblASECContact (ASECContact)
VALUES (""" & NewData & """)", dbFailOnError
'Tell Access you've added the new value
Response = acDataErrAdded
Else
'The user clicked No - discard the new value
Me.Combo137.Undo
'Tell Access you've discarded the new value
Response = acDataErrContinue
End If
db.Close
Set db = Nothing
End Sub
Grateful any advice on solving this problem.
thanks
would like to have these entries listed in alphabetical
order. I have tried :
Private Sub Combo137_AfterUpdate()
Dim FilterString As String
FilterString = "ASECContact = """ & Me.Combo137 & """"
DoCmd.ApplyFilter , FilterString
End Sub
but this does not work? I also have the following code on
this cbo. which allows me to enter new information:
Private Sub Combo137_NotInList(NewData As String,
Response As Integer)
Dim db As Database
Set db = CurrentDb
'Ask the user if they want to add to the list
If MsgBox("Do you want to add this entity to the list?",
vbYesNo + vbQuestion, "Add new value?") = vbYes Then
'The user clicked Yes - add the new value
db.Execute "INSERT INTO tblASECContact (ASECContact)
VALUES (""" & NewData & """)", dbFailOnError
'Tell Access you've added the new value
Response = acDataErrAdded
Else
'The user clicked No - discard the new value
Me.Combo137.Undo
'Tell Access you've discarded the new value
Response = acDataErrContinue
End If
db.Close
Set db = Nothing
End Sub
Grateful any advice on solving this problem.
thanks