Updating control on main from control on sub

7625965

New member
Local time
Today, 13:45
Joined
Jan 5, 2010
Messages
5
Hi,
I'm looking for solution to update the textbox on the main form each time the textbox on subform is updated. I have "txtLastUpdate" textbox on the main form and "txtItemQuantity" textbox on the subform. I'm trying this code:

Private Sub txtItemQuantity_AfterUpdate()
Forms![frmMain]![txtLastUpdate] = Now()
End Sub

It works fine until I try to close the mainform when I get this message (attached). Any ideas what's wrong? Thanks.
 

Attachments

  • SnapShot1.jpg
    SnapShot1.jpg
    20.7 KB · Views: 87
setting the field to now - has produced an error that prevents the record being saved - maybe there is a validation clause in one of the fields that now fails


incidentally - just

parent![txtLastUpdate] = Now()

is all you need
 
Thanks for reply.
I just replaced
Forms![frmMain]![txtLastUpdate] = Now()
with
parent![txtLastUpdate] = Now()
but same message pops up when I try to close main form.
What do I miss here?
 

Users who are viewing this thread

Back
Top Bottom