record count.Possible? Thank you

racerrunner

Registered User.
Local time
Yesterday, 18:19
Joined
May 29, 2005
Messages
32
Hi all,

I'm trying to count the number of record tha have start number with 123"
Can i program the txtSum as shown below?

txtSum.ControlSource = "Select count(*) from Car where "& "Car_number like 123"

And suppose 123 is not hard code.

I.E
number = 123
number =245
etc

txtSum.ControlSource = "Select count(*) from Car where "& "Car_number like number"

Can that be done? Please guide me.



Actually, this form has only 3 controls.


1st control is a combo calls cboSearchField (I populate this control with "Car_number","Car_color","Car_weight"
2nd control is a txtbox calls txtSearchText
3rd control is a txtbox calls txtSum

When i select a value for the combo box(i.e) I expected the user to choose either one of the value assign to the combo box(i.e Car_number)

THen the user will enter some value(i.e 123) in the txtSearchText.

GCriteria = cboSearchField.Value & " LIKE '*" & txtSearchText.Value & "*'"

strSQL = "Select Count(*) from Treatment where " &GCriteria

I'm stuck at this part.

I dont know how to assign the strSQL to the txtSum so that the total number of the record will be reflected in the txtSum.





Thank you
 
Last edited:

Users who are viewing this thread

Back
Top Bottom