I have a Table with a 'Dates' Field as the primary key and 20 other Fields of Integer Type. This is the Master Table with 9 other Detail Tables all with a 'Dates' key field. I have a form to view all this and it works fine.
My problem is to select the row of the Master Table with a date selected by a DateTimePicker Component instead of having to click through lots of rows until I get to the required date.
I have tried all sorts of ways but cannot get close - I have no sample code because nothing I have tried works for me !!
I feel a right idiot because it must be very simple to do it.
Please help !!!

Did you try databinding?

DateTimePicker1.DataBindings.Add( "Value", MasterTable, "Dates" )

I don't think that'll work very well though. If you pick a date that isn't in the table, you'll probably get an exception. How about using a combo box instead of a date time picker? That makes more sense because you're picking from a subset of dates that exist in the table, but a date time picker lets you pick from all possible dates.

Hi
Thanks very much. Got it to work after a while. I am new to VB. Last time i used it was way back in version 1.
It is not quite what I was wanting but is good enough. I see the datetimepicker does not have 'DataSource' and 'DisplayMember' properties. Would it very difficult to add these properties? I have done a bit of modifying components in Delphi.
Thanks again - I will be able to sleep tonight. I live in South Africa so it is getting to bedtime.
Alan

I see the datetimepicker does not have 'DataSource' and 'DisplayMember' properties.

I don't think they make sense for the date time picker. There's probably a few ways you can define them for the control, but I can't think of any that make a date time picker the better choice than a combo box or some other aggregate control except for what the date time picker does now without those two properties.

Would it very difficult to add these properties?

I don't think so, but you'd have to do a lot of micromanagement to make sure that only the data source dates can be selected by the calendar dropdown or spinners.

Thanks for the help. My problem with the combobox is that i have info going back 5 years and the Datetimepicker is easier to use to find the old data if needed.
I think I will try and learn more about VB before experimenting further.
Once again many thanks
Alan

My problem with the combobox is that i have info going back 5 years and the Datetimepicker is easier to use to find the old data if needed.

That's where you can use a date time picker and use the year in its value to filter the data source so that you don't get 5 years of dates in the combo box. :)