Moving data from two forms into subforms

  • Thread starter Thread starter Goran
  • Start date Start date
G

Goran

Hi, I'm writing with one question, so please help.

I have one form with subform and the button. When I press button, it
opens me one another form in which I choose one record. Data from that
record should be moved in subform and also to add some data from the
first form (from the temporary record which was inside when I press
the button.

Thnx.
 
Hi,

I would play safe and add the records through SQL and requery the
appropriate forms:


CurrentDb.Execute "INSERT INTO tableName(listOfFields)
VALUES(ListOfValues) "



insert a record in the specified table, with the values matching the fields.
Note that delimiter are required, unless you use DoCmd and
FORMS!FormName!ControlName :


DoCmd.RunSQL "INSERT INTO tableName(f1, f2, f3) VALUES(
Forms!formX!A, Forms!formX!B, Forms!formX!C) "



Since the VBA code is another user, the already open forms won't see the
newly added record unless you re-open the forms, or requery them (or
respecify their record source to itself).



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top