Data appearing when should be blank till user inputs

Hi guys,

Back again once again....embarrassed

I have a VB.NET front end, which is linked to a access database table (2003) using Jet 4.0

The data is all there, and works correctly,
The problem is, when I click on ADD new record, any fields that have a DATE input, all insert current date. ( Also check box fields appear all filled in )
These fields need leaving blank until the user inputs a date, as some of them relate to future delivery dates.

Sorry if this isn`t technical, not sure how to describe but I think that is it basically.

The question is;

How can I stop the DATE data apprearing, when it should just be a NULL ( Access Term ) field until the user enters the date ?
This is the code studio creates automatically when i use the wizard thingy:-

Code:


PrivateSub bindingNavigatorSaveItem_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs) Handles bindingNavigatorSaveItem.Click
IfMe.ValidateThen
Me.Customer_DataBindingSource.EndEdit()
Me.Customer_DataTableAdapter.Update(Me.DataSet1.Customer_Data)
Else
System.Windows.Forms.MessageBox.Show(Me,"Validation errors occurred.","Save", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning)
EndIf

EndSub

The only other code in here that relates to the data that is in access is as follows:-

Code:


'TODO: This line of code loads data into the 'DataSet1.Glass_Suppliers' table.
Me.Glass_SuppliersTableAdapter.Fill(Me.DataSet1.Glass_Suppliers)
'TODO: This line of code loads data into the 'DataSet1.Roof_Suppliers' table.
Me.Roof_SuppliersTableAdapter.Fill(Me.DataSet1.Roof_Suppliers)
'TODO: This line of code loads data into the 'DataSet1.Panel_Suppliers' table.
Me.Panel_SuppliersTableAdapter.Fill(Me.DataSet1.Panel_Suppliers)
'TODO: This line of code loads data into the 'DataSet1.Frame_Suppliers' table.
Me.Frame_SuppliersTableAdapter.Fill(Me.DataSet1.Frame_Suppliers)
'TODO: This line of code loads data into the 'DataSet1.Fitting_Team' table.
Me.Fitting_TeamTableAdapter.Fill(Me.DataSet1.Fitting_Team)
'TODO: This line of code loads data into the 'DataSet1._MaterialsLabour' table.
Me.MaterialsLabourTableAdapter.Fill(Me.DataSet1._MaterialsLabour)
'TODO: This line of code loads data into the 'DataSet1.Customer_Data' table.
Me.Customer_DataTableAdapter.Fill(Me.DataSet1.Customer_Data)

Thanks in advance guys. I'm sure its simple, but I couldn`t find the answer in any of my books.
( They dont show you how to fix things )

Best Wishes

Max

Access 2003 ( For Data Sets Backend )
Visual Studio 2005 Beta 2
Windows XP SP2
Total programming Beginner - Using .Net as first language !!!!

MSN ID: max_nvision[remove this]@yahoo.co.uk

[4085 byte] By [MaxVernon] at [2007-12-16]
# 1
Hi guys,

Just been looking into this abit more, and have found ( I think ) Where my problem lies.

I have looked at the default value of the data fields in question.
They are already set to Null

The value it self actually says Default Value: <DBNull>
NullValule: (Throw exception)

I have never seen the NullValue before, could this be causing the problem, and what does Throw exception mean ?
My book doesn`t tell me, and my internet searches come up with stuff that is just beyond my to be honest.
Apart from the above, I cant see anything that would effect these fields.
I have even gone back into my access dataset, and their values are also set to Null.

Thas has me baffled.

Max
[edit]

Looking further into this, I have found that I can change the Throw Exception Field. ( Which I now think is the culprit of my problem )
However, when I try this I get the floowing message
"Propert Value is not Valids"
"For columns not defined as System.String, the only valid value is (Throw exception)."
Could anyone tell me what this means please, and if there is away round this so that I can get the Null fields in place.

MaxVernon at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Has anyone got any Ideas please ?
This has really got me stumpped !!

Thanks in advance.

MaxVernon at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
<qoute>I have even gone back into my access dataset</quote>

Is this the actual Access Database or a dataset in your App? You can set default values for the column to be = Today() in the Access Database!

As far as using a null value try:

MyValObject = System.DBnull.Value

DMan1 at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
Dman,

Again, thank your for coming to my rescue ( my superman ) lol

The data is in my access database backend, not within my app.
Connected using Jet 4.0 as we dont have SQL.

I have tried to create using the properties section in the design view to make the data default Empty or Null and It wont let me select them. ( As described in my previous posts.

I have put in what you asked, but it says "My ValObject not declared"
The code is as below ( for one of the fields that is coming up with data not wanted)

Private Sub Contract_DateDateTimePicker_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Contract_DateDateTimePicker.ValueChanged

MyValObject = System.DBNull.Value

End Sub

Im obviously got to change the MyValObject to something else, or declare this somewhere, but I seem to have got myself confused.
Looked in my books, but keep going down in different tanjents and getting my head toed in knots.
Lots of stuff to look into and learn.

Any help ( again ) is much appreciated.
Just ordered a book totaly explaining variables, events, declarations etc etc.....
Hope this helps me !!!

Thanks for your time once again.

Best wishes

Max

MaxVernon at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...