save a subform from another form

PrittyMe143

Registered User.
Local time
Tomorrow, 01:41
Joined
Nov 11, 2002
Messages
16
i got a form which has a subform. to add entries to the subform, another form will be opened. from the newly opened form, i can paste the current record. but the problem is i can only add up to 1 record only because the subform does not advance to a new record. i tried requerying the subform but an error occurs telling that i need to save it first. the question how will i do it?

hope all u kindhearted guys help me with this.
 
Why not just add the additonal records to the table which is the recordsource of your subform, as opposed to pasting them to the subform?
 
whew! thanks for the idea pal but i have figured it out myself.

i need to have another form because that new form is based from another table thought the type of data is quite similar.

what i did was:

1. before the new form will be opened, from the subform the focus must be on the new record.

2. when the new form is already open and the current record has to be pasted, this is what i did.
a. [mainForm]![subform].[Form]![field1] = Me.[field1]
'copy the fields that i want to paste
b. [mainform]![field1].SetFocus
'to move the focus coz everytime you move the forcus from the newly pasted record, the record is saved

3. then i make a macro for an AfterUpdate event wherein i requery the subform and again move the focus to the new record of the subform... (blah!), (blah!)
 

Users who are viewing this thread

Back
Top Bottom