Quote:
I get the error message "Data type mismatch in criteria expression" when running the coding(bold). So i am not sure what is going wrong. Thanks for helping.
- Select Case (cbMonth.Text)
-
Case "January"
-
-
Dates = "1"
-
-
Case "February"
-
-
Dates = "2"
-
-
Case "March"
-
-
Dates = "3"
-
-
Case "April"
-
-
Dates = "4"
-
-
Case "May"
-
-
Dates = "5"
-
-
Case "June"
-
-
Dates = "6"
-
-
Case "July"
-
-
Dates = "7"
-
-
Case "August"
-
-
Dates = "8"
-
-
Case "September"
-
-
Dates = "9"
-
-
Case "October"
-
-
Dates = "10"
-
Case "November"
-
-
Dates = "11"
-
-
Case "December"
-
-
Dates = "12"
-
-
End Select
-
-
-
con3.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Documents and Settings\LICHIN\Desktop\mys\YS.mdb"
-
-
con3.Open()
-
ds3.Clear()
-
sql3 = "SELECT * FROM sumPercent WHERE dates = " & cbMonth.Text & " AND Year(dates) = " & cbYear.Text & " AND plants = '" & yieldsummary.cbPlant.Text & "'"
-
-
da3 = New OleDb.OleDbDataAdapter(sql3, con3)
-
da3.Fill(ds3, "sumPercent")
-
con3.Close()