On Not in list

  • Thread starter Thread starter Pietro
  • Start date Start date
P

Pietro

Hi,
I've a combo box called "escalated by",i set its property "Limit to list"
to Yes...
Now i need to create my own message that appears to users incase they enter
a value that is not in list,i need also to diable the message prouced by MS
Access as long as I'll create mine...
Do you have suggestions?
 
Put your message in the control's NotInList event, and set

Response = acDataErrContinue

in that procedure to prevent the default message from occuring.
 
Here is some code I use where NCOriginator is the field on the form

Dim db As Database, rs As Object, Answer As Integer
Answer = MsgBox("Are you sure you want to add a new originator?", vbYesNo,
"New Originator")
If Answer = vbYes Then
Set db = CurrentDb
Set rs = db.OpenRecordset("lkpOriginators", dbOpenDynaset)
rs.AddNew
rs.Fields("Originator") = NewData
rs.Update: rs.Close
Response = acDataErrAdded
NCOriginator = NewData
Else
SendKeys "{Enter}"
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