Hi my vb code for the form at present is:
Option Compare Database
Private Sub Action_Total_DblClick(Cancel As Integer)
Me.Action_Total = IIf(Action1 Like "rub*", 1, 0) + IIf(Action2 Like
"rub*", 1,
0) + IIf(Action1 Like "wash*", 1, 0) + IIf(Action2 Like "wash*", 1, 0)
End Sub
Private Sub Form_Current()
Me.Opp_Total = (IIf(IsNull([txtIndication1]), 0, 1)) + (IIf(IsNull(
[txtIndication2]), 0, 1)) + (IIf(IsNull([txtIndication3]), 0, 1))
Me.Action_Total = IIf(Action1 Like "rub*", 1, 0) + IIf(Action2 Like
"rub*", 1,
0)
End Sub
Private Sub Opp_Total_DblClick(Cancel As Integer)
Me.Opp_Total = (IIf(IsNull([txtIndication1]), 0, 1)) + (IIf(IsNull(
[txtIndication2]), 0, 1)) + (IIf(IsNull([txtIndication3]), 0, 1))
End Sub
Private Sub Q_Total_DblClick(Cancel As Integer)
End Sub
Code for my query is:
SELECT testbw.id, testbw.Indication1, testbw.Action1, testbw.Indication2,
testbw.Action2, testbw.Indication3, testbw.Action4, Sum((IIf(IsNull(
[Indication1]),0,1))+(IIf(IsNull([Indication2]),0,1))+(IIf(IsNull(
[Indication3]),0,1))) AS indcount, Sum(IIf([action1] Like "rub*",1,0)+IIf(
[action2] Like "rub*",1,0)) AS countaction, [indcount]*[countaction] AS
Total
FROM testbw
GROUP BY testbw.id, testbw.Indication1, testbw.Action1,
testbw.Indication2,
testbw.Action2, testbw.Indication3, testbw.Action4;
My form uses the info from the query, hope that makes it abit clearer.
Gina said:
PRodgers4284,
In an unbound field on a form and/or report you can place
=[Opp_Total]+[Action_Total]
However, you did not mention where it is you are tyring to sum these two
fields so my suggestion may not be applicable. A few more details are
required if the above does not answer your question.
I want to sum two fields together but im unsure how to do this, i have
two
field called "Opp_Total" and "Action_Total" and i would like to add the
values from this two fields together. Can anyone provide some help?