Originally Posted by
June7
You are doing copy/paste of a record?
...If you want data carried forward to new record, one method is to set the DefaultValue property of each control that you want the data to carry forward. Use the AfterUpdate event of each control or the BeforeUpdate event of form...
Since the Control in question isn't Visible, one has to assume that it isn't being populated physically, i.e. through the keyboard, and so its AfterUpdate event won't be firing, so I think the second suggestion, using the Form_BeforeUpdate event, is going to have to be the way to go, with June7's approach.
Another approach would be to have custom copy hack that
- Unhides the hidden Control
- Copies the Record
- Moves to a New Record
- Pastes the data in
- Re-hides the Control in question
Something like this:
Code:
Private Sub cmdCopyRecord_Click()
Me.HiddenField.Visible = True
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdPaste
Me.HiddenField.Visible = False
End Sub
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007