Abort the not in list event if a condition is true

E

Erik

Hi,

im using a not in list event that i want to abort if the following condition is true

If Len(Me.textbox & "") <> 9 The

MsgBox "Warning - too few digitis enteredr!
Cancel = Tru

It dosent seem to work when i use this direct in my not in list event. The not in list event triggers a sql that inserts a value in my "Selskap" table. All values included in this are text.

Any ideas?

Eri
 
J

JeffW

Erik,

What is not working? Is the text being added regardless? Just a guess, but
have you tried using "NewData" instead of the control name?

'untested
If Len(NewData & "")<>9 Then
Response = acDataErrContinue
MsgBox "Warning - too few digits entered!"
Me.Undo
Else
'your sql here
End If

HTH,
Jeff


Erik said:
Hi,

im using a not in list event that i want to abort if the following condition is true:

If Len(Me.textbox & "") <> 9 Then

MsgBox "Warning - too few digitis enteredr!"
Cancel = True

It dosent seem to work when i use this direct in my not in list event. The
not in list event triggers a sql that inserts a value in my "Selskap" table.
All values included in this are text.
 
E

Erik

thnx..
ofcourse.. newdata.. that would do the trick yes..

Thank you for your reply!

Erik
 

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

Top