Originally posted by lfc1lfc
I have this error handling statement:

on error goto fix:

fix: data1.Recordset.CancelUpdate

on the same statement i.e. fix I want to add this:

MsgBox "If a field is not filled in please enter N/A. This Record will not be saved", vbExclamation

I want this to come up along with CancelUpdate, but when I put it on the same line as data1.Recordset.CancelUpdate, I get a message saying "Expected end of statement"

Is there a way of doing what I want to do?
VB Code:
  1. on error goto Fix:
  2.  
  3.  
  4. Exit Function '(Or sub)
  5.  
  6. Fix:
  7. data1.Recordset.CancelUpdate
  8. MsgBox "If a field is not filled in please enter N/A. This Record will not be saved", vbExclamation
  9. Exit Function '(Or sub)

My usual debug message:

VB Code:
  1. Msgbox Err.Description, , "Error #" & Err.Number