Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save and update 1

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Hoy,

I have a checkbox in my subform. When I set it to YES (True) an update query should set the actual date in the underlying table.
When A user is clicking in the checkbox and the condition is True update the field Date with (date).
The query itself is working fine, but from in the form is is not working. The moment the user is clicking the checkbox, the record is not already saved and the event After Update is evaluated.
I wonder, how can I save the record before the query is running in the procedure.
Which event should be recommanded in this case After Update ?

Code:
Private Sub Inv_received_AfterUpdate()

DoCmd.SetWarnings False
DoCmd.OpenQuery "QryODD", acNormal, acEdit
'DoCmd.RunSQL "UPDATE Order_details SET Order_details.[Inv received_date] = Date() " _
'& "WHERE ((([Order_details].[OrderDet_ID])=360 or the name of the subform) And (([Order_details].[Inv received])=True));"
DoCmd.SetWarnings True
End Sub

 
DoCmd.SetWarnings False
[!]Me.Dirty = False[/!]
DoCmd.OpenQuery "QryODD", acNormal, acEdit

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top