Hi Guys
The following code runs but doesn't give me right result. Both i and J values come up wrong. I think there is some problem in Date criteria. Can anybody please have a look and help me to solve my problem.
Thanks
The following code runs but doesn't give me right result. Both i and J values come up wrong. I think there is some problem in Date criteria. Can anybody please have a look and help me to solve my problem.
Code:
Private Sub Command4_Click()
Dim i As Integer
Dim j As Integer
Dim sum As Integer
i = DCount("username", "tbldata", "not username is null and [Date GoneAway Received]>=#" & Format(Combo0, "dd/mm/yyyy") & "# and [Date GoneAway Received]<=#" & Format(Combo2, "dd/mm/yyyy") & "#")
j = DCount("username", "tblmain", "not username is null and [Date GoneAway Received]>=#" & Format(Combo0, "dd/mm/yyyy") & "# and [Date GoneAway Received]<=#" & Format(Combo2, "dd/mm/yyyy") & "#")
sum = i + j
Label8.Caption = sum
End Sub
Thanks