Heatshiver
Registered User.
- Local time
- Today, 17:39
- Joined
- Dec 23, 2011
- Messages
- 263
I need to copy a main form and subform's values to a new record. I can get the main form to copy its values over with the following code:
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdPasteAppend
However, this does not affect the subform at all and just leaves it blank. I have been scouring the web and have found what I thought would be viable methods such as setting focus to the subform and such. But nothing seems to work.
What is the best way in VBA to copy the values of all fields in a subform so that I can combine it with the code above? Thanks for the help.
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdPasteAppend
However, this does not affect the subform at all and just leaves it blank. I have been scouring the web and have found what I thought would be viable methods such as setting focus to the subform and such. But nothing seems to work.
What is the best way in VBA to copy the values of all fields in a subform so that I can combine it with the code above? Thanks for the help.