insert a new record and calculated values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have my forms calculate a text value when the user moves to the next record
and on open, but when you insert a new record it throws an error. Is there
anyway to get a round this or a better way to have it calculate the text
value rather than with the on current event procedulre. The code for the
calculations is several lines long and involves several if-statements.
 
Dan said:
I have my forms calculate a text value when the user moves to the
next record and on open, but when you insert a new record it throws
an error. Is there anyway to get a round this or a better way to have
it calculate the text value rather than with the on current event
procedulre. The code for the calculations is several lines long and
involves several if-statements.

Why not just have your Current event procedure check for the new record
and act accordingly? You can use the form's NewRecord property to do
this:

If Me.NewRecord Then
' we're on a new record
Else
' we're not.
End If

Or you may be able to revise your calculation code so that it doesn't
give an error when you're on a new record (probably due to Null fields).
To get help with that here, you'd need to post the code and tell us what
error you get, and where.
 

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

Back
Top