|
-
Nov 20th, 2000, 03:01 PM
#1
Thread Starter
New Member
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
-
Nov 20th, 2000, 03:46 PM
#2
Fanatic Member
...
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
-
Nov 20th, 2000, 03:58 PM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|