Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    16

    Unanswered: Parameter Query Help

    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

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try to use

    abdul.Entry_date = & cDate((Me.calrecon.Value))&

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by hammbakka
    Try to use

    abdul.Entry_date = & cDate((Me.calrecon.Value))
    Sorry
    there is no [&] at the end
    abdul.Entry_date = & cDate((Me.calrecon.Value))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •