Results 1 to 3 of 3

Thread: DTpicker & ADO

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    5

    Question

    Hi all,

    I'm new in vb and trying to get into ADO and DTpicker.

    I have some problems with dbgrid and the DTpicker. I would like to search on the date that DTpicker is showing!! But the dbgrid is empty.

    Here is the code i'm trying, when I use the msgbox i can se the date that the Dtpicker is showing.

    Please help me :-))

    Private Sub Command2_Click()
    Dim test As Date

    test = DTPicker1.Value

    'MsgBox "hello " & test

    Adodc1.RecordSource = "SELECT * FROM Ugerapport WHERE Dato=" & test & ""
    Adodc1.Refresh

    End Sub

    regards,
    Allan Bech

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ...


    Adodc1.RecordSource = "SELECT * FROM Ugerapport WHERE Dato=" & test & ""
    Adodc1.Refresh


    Try to put test in single quotes as follows


    Adodc1.RecordSource = "SELECT * FROM Ugerapport WHERE Dato='" & test & "'"
    Adodc1.Refresh


    let us know

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    5

    Talking Thanks

    Hi Lafor

    Thanks for your quick reply :-))

    I found some MS Access information and now it works..

    Here is the code that works

    Adodc1.RecordSource = "SELECT * FROM Ugerapport WHERE Dato=#" & test & "#"
    Adodc1.Refresh

    I have tried with the quotes but it didn't work in my code!!

    Anyway thanks again..

    Regards
    Allan


Posting Permissions

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



Click Here to Expand Forum to Full Width