Hi,
I am trying to retreive values from a Query "abdulQuery" where the Location is the one which the user selects from the combo box "cmb_location" and date is the user selection from Calendar control "calrecon". The datatype for the field Location is text and for the field Entry_date is Date
The following is the code:
'connection already established
Dim qrySel1 As String
Dim rs6 As New ADODB.Recordset
qrySel1 = "SELECT abdulQuery.* from abdulQuery where abdul.Location='" & Trim(Me.cmb_location.Value) & "' and abdul.Entry_date = '" & (Me.calrecon.Value) & "'"
Set rs6 = New ADODB.Recordset
rs6.Open qrySel1, con, adOpenKeyset, adLockOptimistic
The problem is when I try to execute it gives me error: "Datatype mismatch in criteria expression". Can anyone help me out?
I am trying to retreive values from a Query "abdulQuery" where the Location is the one which the user selects from the combo box "cmb_location" and date is the user selection from Calendar control "calrecon". The datatype for the field Location is text and for the field Entry_date is Date
The following is the code:
'connection already established
Dim qrySel1 As String
Dim rs6 As New ADODB.Recordset
qrySel1 = "SELECT abdulQuery.* from abdulQuery where abdul.Location='" & Trim(Me.cmb_location.Value) & "' and abdul.Entry_date = '" & (Me.calrecon.Value) & "'"
Set rs6 = New ADODB.Recordset
rs6.Open qrySel1, con, adOpenKeyset, adLockOptimistic
The problem is when I try to execute it gives me error: "Datatype mismatch in criteria expression". Can anyone help me out?