copy value from sub form coulmn to to subform column

  • Thread starter Thread starter 1aae
  • Start date Start date
1

1aae

thank you
I have subform and main form the subform contain 3 column
fk pk empname
1 asdf
2 asdfsad
3 sdfasdf
I want to use command button in main form What this command do:
copy all cell in pk to fk cells (copy pk column to fk column)
the previous example will be:
fk pk empname
1 1 asdf
2 2 asdfsad
3 3 sdfasdf
Notes:
I will need this with subform (I can't use query because there is no
condition and i have many reason also) I need only use man form and subform
any help appreciated
 
Hi,



An update query can update "en masse":

DoCmd.RunSQL "UPDATE myTable SET fk=pk"

You can also add a where clause to limit the records that are to be updated,
like:

DoCmd.RunSQL "UPDATE myTable SET fk=pk WHERE fk IS NULL"


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top