Moving data from form to form

  • Thread starter Thread starter James
  • Start date Start date
J

James

I have the following code:

me!RefNum = forms!FormFirst!RefNum

I have been told to place this in the On Insert and I have
a before Insert and After Insert no On Insert where could
I find this?

Many Thanks

James
 
James said:
I have the following code:

me!RefNum = forms!FormFirst!RefNum

I have been told to place this in the On Insert and I have
a before Insert and After Insert no On Insert where could
I find this?

You're right. There is no "On Insert". BeforeInsert is probably what was
intended. That event fires when a new record is first "dirtied" by a
keystroke from the user and occurs well before the record is saved so
assigning values during that event should work fine.

I did recently discover though that there are circumstances where a new
record can be created and saved without BeforeInsert ever firing. If the
record is first dirtied by a macro or code then the BeforeInsert doesn't
fire. As long as you're sure that this isn't the case for your form you
should be ok.
 
I have put the code in the before insert property and I
still get this object required. Do we have any idea as to
what this could be?

I have the following code on a button which opens the form
which is :

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmSubstanceUse"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.RunCommand acCmdRecordsGoToNew
frmAssesment.Visible = False

Then on the before insert on the form (and have tried this
on the actual field) I have the following code:

Me!Ref = Forms!frmAssesment!Ref

Is there anything there that should stop it from working?

Many Thanks

James
 
Back
Top