Can someone help me with update stmnt please?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am calling the details form from master form. When the amount in the detail
form changes, I need to update amount in the master form.

I want to ensure the amount in the main form changes when user saves changes
in the master. As per the flow of the form, user is asked to save changes in
detail, at that time I want to update just the amount in the master form.
'cause if user changes anything in master form user is prompted to save
changes or discard, I won't want user to be prompted for amount changes in
the detail form. However, he should be prompted for any other modifications
in the master form.

I don't remember the syntax for update, can somone help me?
Or Is there a better way to approach this?

Thanks in advance ...
-Me
 
Why not use a PUBLIC var to hold the value in the Main form. Then, in the
detail, do the appropriate math on the Public var. Then update the record in
the Main form with the value in the Pulic var?

If you want syntax, here's some:


Set dbConn = CurrentProject.Connection ' New ADODB.Connection

Set recSet = New ADODB.Recordset
recSet.CursorLocation = adUseClient
recSet.CursorType = adOpenForwardOnly
recSet.LockType = adLockOptimistic
recSet.ActiveConnection = CurrentProject.Connection

recSet.Open "update tblMyTable, set myValue = " & pubMyVal & " where
myKey = '" & Me.myKey "'"

Set recSet = Nothing
dbConn.Close
 
Back
Top