R
Ruth
I've run into a problem getting a Before Update event to launch. I'm
trying to update the LastUpdate field with the current date and time
when data on a form is changed.
The control is on a subform, which is also located on a tab control.
I've checked the code on a "plain" form so I know it works, but I'm
missing something when trying to make it work on the subform.
Form Name: frmVisits
Subform Name: frmVisitOrgTab
Tab Name: pgVisitInfo
Control Name: LastUpdate (formatted as General Date)
Current Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me![frmVisitOrgTab]![LastUpdate].Value = Now
End Sub
I've tried several different variations to refer to the control, but
nothing so far has changed the date! I have tried attaching the code
to both the main form and the subform. It's currently attached to the
main form.
Other variations already tried:
Me. LastUpdate.Value
Me![frmVisitOrgTab].Form![LastUpdate]
Forms![frmVisits].[Form]![frmVisitOrgTab].[Form]![LastUpdate]
I've also tried to accomplish with a macro. No luck.
Ideas, suggestions, guidance will be appreciated. Thanks!
Ruth
trying to update the LastUpdate field with the current date and time
when data on a form is changed.
The control is on a subform, which is also located on a tab control.
I've checked the code on a "plain" form so I know it works, but I'm
missing something when trying to make it work on the subform.
Form Name: frmVisits
Subform Name: frmVisitOrgTab
Tab Name: pgVisitInfo
Control Name: LastUpdate (formatted as General Date)
Current Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me![frmVisitOrgTab]![LastUpdate].Value = Now
End Sub
I've tried several different variations to refer to the control, but
nothing so far has changed the date! I have tried attaching the code
to both the main form and the subform. It's currently attached to the
main form.
Other variations already tried:
Me. LastUpdate.Value
Me![frmVisitOrgTab].Form![LastUpdate]
Forms![frmVisits].[Form]![frmVisitOrgTab].[Form]![LastUpdate]
I've also tried to accomplish with a macro. No luck.
Ideas, suggestions, guidance will be appreciated. Thanks!
Ruth