Updating subform controls

Lissa

Registered User.
Local time
Today, 04:09
Joined
Apr 27, 2007
Messages
114
I have a subform that displays part information on a master form. (The subform is on a tab display).
In the AfterUpdate event of the Serial Number control (on the subform) I have this code:

If Me.SerialNumber <> "TBD" Then
TransactionDate = Now()
StatusId = 2
DateReceived = Now()
DoCmd.RunCommand acCmdSaveRecord

End If


As the user updates the Serial Number with a valid number, the statusId and DateReceived fields are updated immediately as the user moves to the next record - which is what I want to happen.... but the TransactionDate field never updates until I close the form and reopen or click on another subform tab and return to the subform.
I have tried Form.Requery but that will lose the current record focus and the user is placed at the first record.
I'd like to understand why StatusId and DateRecieved will update immediately but the TransactionDate will not ? Is there another method I can use to update that field without losing current record focus?

Thanks
 
Are all three fields in the same record in the same table?
 
Hi RuralGuy -
Yes - they are all in tblPartStatus
 
You may be looking at an anomaly of having controls and fields named the same. Put a Me.Refresh after the DoCmd.RunCommand acCmdSaveRecord and see if it makes any difference. I assume all three fields are bound to visible controls on your form.
 
Yes - all three fields are bound to visible conrols on the form.

WOHOO! Your suggestion worked great.

Thanks!!
 

Users who are viewing this thread

Back
Top Bottom