
Copying fields from one table to another
Put this code into your command button
Dim strForeName as String, strSurName as String
strForeName = Me!tbx_forename 'textbox with forename
strSurName = Me!tbx_surname 'textbox with surname
DBEngine(0)(0).Execute "INSERT INTO Table2 ( oldforename , oldsurname)
SELECT '" & strForeName & "' AS Expr1, '" & strSurName & "' AS Expr2;"
With this methode you paste the values of those fields into Table2, but are
you sure you want to do that ?
Would this duplicate information in your DB ?
Kind regards
Hans-Christian Francke
www.master-office.com
Quote:
> Has anyone got any suggestions
> I have two tables table1 and table2
> Form1 is based on table1.
> I want a command button on the form that takes two of the values from the
> current record (say forename and surname) on Form1 and adds them to table2
> (places them in the fields oldforename and oldsurname)
> Many thanks in advance
> Gary H
> --
> visit www.ponsanooth.org.uk or www.falmouthcc.org.uk