Having a bit of trouble in Access VBA. Using the code portion below I am using VBA to count records in a record set. Essentially I am counting records in a Section named 68 (record type is not a number but short text). The one that I have Dimensioned as K68Over14 works but K68all gives me a Type Mismatch error Run-Time Error '13':
I feel it is because it is a number but it doesn't make why one would work but one would not when the code is almost exactly the same.
Dim K68all As String
Dim K68OVER14 As String
Does not Work:
ElseIf MyRs![CAL_AREA_1] = "68" Then
K68all = K68all +1
Works:
ElseIf MyRs![DAYS_IN_LAB] > 14 And MyRs![CAL_AREA_1] = "68" Then
K68OVER14 = K68OVER14 + 1