In my datagridview I have 3 columns, lets say Column1, 2, 3.
Column1 is Column2 / Column3.
Problem I have is I'm trying to prevent an error if the user types "0" into Column 2 or 3. I can prevent against it dividing by null or a letter by the following codes:
andCode:If Not IsNull(Me.DataDataGridView1.CurrentRow.Cells("Column2").Value) Then
But, I can't protect it from someone typing "0" because zero is numeric andCode:If IsNumeric(Me.DataDataGridView1.CurrentRow.Cells("FieldName").Value) Thencauses problems as well because it treats 0 as null.Code:If Me.DataDataGridView1.CurrentRow.Cells("FieldName").Value = 0 Then
Any ideas are appreciated.




Reply With Quote
