I would like to count the records number according to the two dates that specified on the form.
The following codes are used, but it returned me the number for all the records.
MyDate is in the format of mm/dd/yyyy
Me.TxtTotalRec.Value = DCount("MyDate", "MyTable", "'MyDate<= [Forms]![MyForm]![TextEndDate]' And 'MyDate>= [Forms]![MyForm]![TextStartDate]'")
I also tried this, then there's a type mismatch error.
Me.TxtTotalRec.Value = DCount("MyDate", "MyTable", "MyDate<= [Forms]![MyForm]![TextEndDate] And MyDate>= [Forms]![MyForm]![TextStartDate]")
Anybody knows the right one?
Thanks a lot!
SwingXH
The following codes are used, but it returned me the number for all the records.
MyDate is in the format of mm/dd/yyyy
Me.TxtTotalRec.Value = DCount("MyDate", "MyTable", "'MyDate<= [Forms]![MyForm]![TextEndDate]' And 'MyDate>= [Forms]![MyForm]![TextStartDate]'")
I also tried this, then there's a type mismatch error.
Me.TxtTotalRec.Value = DCount("MyDate", "MyTable", "MyDate<= [Forms]![MyForm]![TextEndDate] And MyDate>= [Forms]![MyForm]![TextStartDate]")
Anybody knows the right one?
Thanks a lot!
SwingXH