JumpinJimRivers
MIS
I know something's wrong with the code below, but I don't know what. I am wanting to update the subform field "Total" based on WorkItemID criteria from another subform after a new amount has been entered. Right now it's giving me the error message "Too few parameters. Expected 1" whatever that means.
Dim MyDB As Database
Dim Rec As Recordset
Dim SQLString As String
SQLString = "SELECT [Sub Billing Items Monthly].WorkItemID, Sum([Sub Billing Items Monthly].Amount) AS SumOfAmount from [Sub Billing Items Monthly]GROUP BY [Sub Billing Items Monthly].WorkItemID HAVING ((([Sub Billing Items Monthly].WorkItemID)=[me]![workitemid]))"
Set MyDB = CurrentDb()
Set Rec = MyDB.OpenRecordset(SQLString)
Me.Parent![billing work items subform]![Total] = Rec!SumOfAmount
make sense????
Dim MyDB As Database
Dim Rec As Recordset
Dim SQLString As String
SQLString = "SELECT [Sub Billing Items Monthly].WorkItemID, Sum([Sub Billing Items Monthly].Amount) AS SumOfAmount from [Sub Billing Items Monthly]GROUP BY [Sub Billing Items Monthly].WorkItemID HAVING ((([Sub Billing Items Monthly].WorkItemID)=[me]![workitemid]))"
Set MyDB = CurrentDb()
Set Rec = MyDB.OpenRecordset(SQLString)
Me.Parent![billing work items subform]![Total] = Rec!SumOfAmount
make sense????