A
andycambo via AccessMonster.com
Hi,
I am trying to open a form (frmCurrentTimes) which has text boxes with DSum
calculations in, which calculates times from a table based on a filter.
What I need to do is open the form, filter the results, calculate the
findings and show the results.
My code for the button is this:
Private Sub btnCurrentTimesMags_Click()
Dim theMatterID As Long
theMatterID = Me.mID
DoCmd.OpenForm "frmCurrentTimes", , , "tFundingMethod = '" & "M" & "' OR
tFundingMethod = '" & "LM" & "' AND tMatterID=" & theMatterID
End Sub
My text boxes are like this
=DSum("[tTravelTime]","tblTimeRecord","tMatterID = " & [mID])
But everytime I open the form the text boxes calculate everything under the
matterID regardless of the the tFundingMethod is. Where I want it to only
calculate times with the funding method "M" and "LM"
Have I got the code correct on the button? Or have I got the text boxes
wrong? Or am I completly wrong?!
Any help is appreciated.
Thanks
Andy.
I am trying to open a form (frmCurrentTimes) which has text boxes with DSum
calculations in, which calculates times from a table based on a filter.
What I need to do is open the form, filter the results, calculate the
findings and show the results.
My code for the button is this:
Private Sub btnCurrentTimesMags_Click()
Dim theMatterID As Long
theMatterID = Me.mID
DoCmd.OpenForm "frmCurrentTimes", , , "tFundingMethod = '" & "M" & "' OR
tFundingMethod = '" & "LM" & "' AND tMatterID=" & theMatterID
End Sub
My text boxes are like this
=DSum("[tTravelTime]","tblTimeRecord","tMatterID = " & [mID])
But everytime I open the form the text boxes calculate everything under the
matterID regardless of the the tFundingMethod is. Where I want it to only
calculate times with the funding method "M" and "LM"
Have I got the code correct on the button? Or have I got the text boxes
wrong? Or am I completly wrong?!
Any help is appreciated.
Thanks
Andy.