Maybe i should explain my problem a bit more. I have a form which handles my database access, lets call it DB. On this form i have a bindingsource, a tableadapter, a dataset and a bindingnavigator. When double clicking the dataset you see the table and all its fields and the defined querys. now when you click one of the fields the datasets .vb file opens and you can add custom validation. I added my validation in the columnchanging event. Now when the event is fired and one of the datetimecolumns are changed i need to know the values of 2 datetimepickers in the DB from.
If DB.BeginDatumTijdDateTimePicker.Value >= DB.EindDatumTijdDateTimePicker.Value Then
e.Row.SetColumnError("BeginDatumTijd", "BeginTijd mag niet groter of gelijk zijn aan EindTijd")
Else
If e.Column Is Me.BeginDatumTijdColumn Then
checkBeginDatumTijd(e.Row)
checkBeginDateTime(e.Row)
checkEindDateTime(e.Row)
End If
If e.Column Is Me.EindDatumTijdColumn Then
checkEindDatumTijd(e.Row)
checkEindDateTime(e.Row)
checkBeginDateTime(e.Row)
End If
End If
When the startingtime is bigger or equal to the endingtime it should bother
validating because it is wrong anyway so i just set the rowerror.
Now when the DB form is the startupform everything works fine. But this is just a small part of my application so it will not be the startupform. When another form is the startupform the 2 datetimepickers contain the date and time of when the form started so they are equal which results in a rowerror.
When i check the values in the DB form they are displayed fine but when i use the code above in the dataset.vb file they are not.
I tried to set the modifier of the datetimepickers to public but that didn't help.
Is there another way to reference the datetimepickers then the way i did?
Or am i doing something wrong here?
I hope my explanation was clear.
Thanks in advance