By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,254 Members | 2,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,254 IT Pros & Developers. It's quick & easy.

Error Trap Null Values

P: n/a
Hi, I'm trying to write an error trap that won't let you continue
unless a price is entered. This is what I have so far.

Private Sub ForecastProductSale_BeforeUpdate(Cancel As Integer)
If IsNull(Me.ForecastProductSale) Then
MsgBox "A Product Sale needs to be entered.", vbOKOnly
Exit Sub
End If
End Sub

Can someone please tell me what I'm doing wrong?

Thanks.

Jan 10 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try: "Cancel = True" instead of "Exit sub"

Arno R

<er************@gmail.comschreef in bericht news:11**********************@77g2000hsv.googlegro ups.com...
Hi, I'm trying to write an error trap that won't let you continue
unless a price is entered. This is what I have so far.

Private Sub ForecastProductSale_BeforeUpdate(Cancel As Integer)
If IsNull(Me.ForecastProductSale) Then
MsgBox "A Product Sale needs to be entered.", vbOKOnly
Exit Sub
End If
End Sub

Can someone please tell me what I'm doing wrong?

Thanks.
Jan 10 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.