P
Phil Hood
I am trying to assign a value to a variable (NoOfRides)
based on an SQL statement. When I run the procedure, I
get an error message saying "Run time error 13. Type
mismatch"
What am I doing wrong?
Dim dbsCurrent As Database
Dim rstPrepareAveragesData As Recordset
Dim strQuerySQL As String
Dim NoOfRides As Integer
Dim Points As Integer
Dim BonusPoints As Integer
Set dbsCurrent = CurrentDb
NoOfRides = "SELECT Count(Results.RideNo) AS
CountOfRideNo FROM Results HAVING ((([Results]![RiderID])
= " & _
Forms![Heat Edit]![Results Subform].Form![Combo18] & ")
AND (([Results]![ResultDescID])<>1 And ([Results]!
[ResultDescID])<>3));"
based on an SQL statement. When I run the procedure, I
get an error message saying "Run time error 13. Type
mismatch"
What am I doing wrong?
Dim dbsCurrent As Database
Dim rstPrepareAveragesData As Recordset
Dim strQuerySQL As String
Dim NoOfRides As Integer
Dim Points As Integer
Dim BonusPoints As Integer
Set dbsCurrent = CurrentDb
NoOfRides = "SELECT Count(Results.RideNo) AS
CountOfRideNo FROM Results HAVING ((([Results]![RiderID])
= " & _
Forms![Heat Edit]![Results Subform].Form![Combo18] & ")
AND (([Results]![ResultDescID])<>1 And ([Results]!
[ResultDescID])<>3));"