Error handling question

  • Thread starter Thread starter Jen
  • Start date Start date
J

Jen

In a subform I have

Private Sub Form_Current()
Me.timdebitering_Label.Caption = IIf([AddTax] = 1, "á moms 0%", "á inkl
moms")
End Sub

Works ok, changing the label accordingly, but when I add a new record (in
the main form) I get:

Run-time error '3059':
Operation canceled by user.

If I hit end everything works ok. Tried adding some error handling (I hear
it's a good thing) but I only come up with my own error.

Jen
 
You may just want to ignore that error when you have a new record. Try this:

On Error Resume Next
Me.timdebitering_Label.Caption = IIf([AddTax] = 1, "á moms 0%", "á inkl
moms")
if err <> 0 then
select case err
case 3059
'* Ignore
case else
msgbox "Error " & err.number & " - " & err.description
end select
err.clear
end if

Hope this helps,
 
Back
Top