Parameter Query Help (1 Viewer)

sahil

Registered User.
Local time
Today, 23:58
Joined
Jan 12, 2004
Messages
19
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?
 

sahil

Registered User.
Local time
Today, 23:58
Joined
Jan 12, 2004
Messages
19
Thanks for the help. The problem as you have explained was with the delimeter. Thanks once again.
 

Users who are viewing this thread

Top Bottom