Error handling question

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, 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
 
T

TC

If you do not want this to happen when entering a new record, put:

if not me.newrecord then ...
....
endif

around the label caption change.

HTH,
TC
 

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