How to create a duplicate record on the next row

  • Thread starter Thread starter Dou
  • Start date Start date
D

Dou

After I entered a new record in a subform, How to automatically create this
record duplicate to next row as new record?

Thanks
 
I have a similar problems but with forms. I have two tables linked to each
other.I have set main form with two subforms within it. Subforms is the same
from for dependent table, one in tabular forms and another is in justified
view. I want to figure out how to make possible for records entered in
tabular view to be viewed in justified view without restarting forms.
Thanks.
 
I have a similar problems but with forms. I have two tables linked to
each other.I have set main form with two subforms within it. Subforms
is the same from for dependent table, one in tabular forms and another
is in justified view. I want to figure out how to make possible for
records entered in tabular view to be viewed in justified view without
restarting forms. Thanks.

In the AfterUpdate event of all of the controls that may be changed, put
something like the following:

Me.Parent.SubFormControl2.Form.Refresh

Change the "SubFormControl2" to the name of your SubFormControl2

This is not the SubForm but the SubFormControl!

hth
 
Thank you very much for the help. I actually did this in properties for the
whole subform and it worked.
Thanks again
 
Thank you very much for the help. I actually did this in properties for
the whole subform and it worked.
Thanks again

You're very welcome and thanks for posting back.
 
Dou said:
I try to use these code, but can't use in a subform, Why?
Can you help me? thanks.

The only code that goes in the SubForm is:
_________________________________
Call CarryOver(Me)
_________________________________

And that belongs in the BeforeUpdate event of the SobForm.

The actual CarryOver code should be in a normal module called maybe
"basCode".

Where did you put the code?
 
Yes, I put the CarryOver code in a normal module. but I call it using Call
CarryOver(Me) in a subform's BeforeInsert event, it doesn't work, I don't
know why?
I change the Me to the subform name, it still doesn't work.
 
Dou said:
Yes, I put the CarryOver code in a normal module. but I call it using
Call CarryOver(Me) in a subform's BeforeInsert event, it doesn't work, I
don't know why?
I change the Me to the subform name, it still doesn't work.

What is the name of the Normal Module? It can not be "CarryOver" or Access
will get confused. I have not used this code before but in reading it there
are some caveats. It will only work for TextBoxes and ComboBoxes and then
these controls have to be named the same as the bound field. Your form must
also be bound. Kind of limiting actually. I'll go look up another example.

hth
 
I try the code, it works in a main form, but doesn't work in a subform.
I call this function:

Call AutoFillNewRecord([Forms]![OrderAdd]![OrderAddSubform].Form)
 
Dou said:
I try the code, it works in a main form, but doesn't work in a subform.
I call this function:

Call AutoFillNewRecord([Forms]![OrderAdd]![OrderAddSubform].Form)

What does it do in the subform? In looking at the code if it doesn't like
anything it just exits silently. I would put some noisy MsgBox's in the code
to see what it is doing or maybe single step the code.

Good Luck. hth
 
Back
Top