View Full Version : VB specialists help wanted: Would this code work?


princess15s
08-10-2001, 05:46 AM
Private Sub Trade_Date_AfterUpdate()
On Error GoTo Err_Trade_Date_AfterUpdate
Me.Refresh
DoCmd.RunQuery CalcualteNetPrice
DoCmd.RunQuery CalculateSettlementDate
Me.frmTrade(M).Requery

Exit_Trade_Date_AfterUpdate:
Exit Sub

Err_Trade_Date_AfterUpdate:
MsgBox Err.Description
Resume Exit_Trade_Date_AfterUpdate
End Sub

AlanS
08-13-2001, 08:09 AM
Would it work to do what? What does the "(M)" refer to in "frmTrade(M)"?

princess15s
08-14-2001, 12:55 AM
Would this code work? This is a code to requery the two queries Im using to calculate Net Amount and settlement Date. This code is supposed to execute every time I enter or change data. The frmTrade(M) is a file name..

Chris RR
08-14-2001, 04:29 AM
Are you trying to update all the records in your tables each time a form item changes??? Or do you want to update a single field in a single row?

If you answer yes to the first question, then either you are updating some global field, or you have a design problem.

If you answer yes to the second question, there are much better ways to do this.