Moira Triance
Registered User.
- Local time
- Today, 14:08
- Joined
- Sep 27, 2001
- Messages
- 16
OK I give up, I have been round and round this problem and searched the forums for the last 2 hours and I am still stuck.
Here is my simple code for adding a record to a combo box, which works fine except I still get the message "the text you entered isn't in the list" AFTER it runs the event proc and it has added it to the list. Please help because I am going greyer by the minute! It has got to be something really obvious but I just can't see it. Thanks for any help.
Private Sub Amount_NotInList(NewData As String, Response As Integer)
Dim rst As Recordset
Dim db As Database
Set db = Currentdb
Set rst = db.OpenRecordset("tbMedIns")
'add value to tbMedIns if not in list
If MsgBox("Amount is not in list. Add it?", vbOKCancel, "Medical Insurance") = vbOK Then
' Set Response argument to indicate that data is being added.
rst.AddNew
rst!MedInsRate = NewData
rst.Update
Response = acDataErrAdded
Else
Response = acDataErrContinue
Exit Sub
End If
End Sub
Here is my simple code for adding a record to a combo box, which works fine except I still get the message "the text you entered isn't in the list" AFTER it runs the event proc and it has added it to the list. Please help because I am going greyer by the minute! It has got to be something really obvious but I just can't see it. Thanks for any help.
Private Sub Amount_NotInList(NewData As String, Response As Integer)
Dim rst As Recordset
Dim db As Database
Set db = Currentdb
Set rst = db.OpenRecordset("tbMedIns")
'add value to tbMedIns if not in list
If MsgBox("Amount is not in list. Add it?", vbOKCancel, "Medical Insurance") = vbOK Then
' Set Response argument to indicate that data is being added.
rst.AddNew
rst!MedInsRate = NewData
rst.Update
Response = acDataErrAdded
Else
Response = acDataErrContinue
Exit Sub
End If
End Sub