Full Version: Vb.net(visual Studio 2010) Filter Gridview By Datepicker?!
UtterAccess Discussion Forums > And More... > Visual Basic 2003 and Later
dejanc
Hello all,

I`m new in VB.NET, and have problems with syntax. I have a MSAccess database viewed in form as gridview with three columns. First two columns are text format, third one is Date/Time Short format. For first two column I`m using filter, and works fine (I must note Doug Steele has helped me in previous post)

Me.HVseznamBindingSource.Filter = "FirstName Like '" & txtSearch.Text & "*'"

For filter gridview by date I have add DateTimePicker. But having problem add into upper code.

So far is working this code:
Me.HVseznamBindingSource.Filter = "Date = "#12/09/2010#".

How to put DateTimePicker into code?

Thank you in advance for help to anyone!
dejanc
I have write this code

Me.HVseznamBindingSource.Filter = "Date = #" & Me.Datetimepicker.Value & "#"

But it does not work...
dejanc
Just for info, finally have working code :-)

Me.HVseznamBindingSource.Filter = "BirthDate = '" & Me.Datetimepicker.Value.Date & "'"
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.