The following code is causing an 'invalid property value' error when the form is loaded. If the line for the checkbox is commented out the code works fine. I am simply wanting to copy the values from the DataGrid to the form for editing.
With frmInv2
.txtCode.Text = DataGrid1.Columns(0).Text
.txtCode.Locked = True
.txtDescription.Text = DataGrid1.Columns(1).Text
.chkWhsle.Value = DataGrid1.Columns(2).Value
.txtPrice.Text = DataGrid1.Columns(3).Text
I have noticed that if the value is -1 if the check box is checked while a 0 is in the field for unchecked.
Thank you in advance,
Duane
Comments
:
: With frmInv2
: .txtCode.Text = DataGrid1.Columns(0).Text
: .txtCode.Locked = True
: .txtDescription.Text = DataGrid1.Columns(1).Text
: .chkWhsle.Value = DataGrid1.Columns(2).Value
: .txtPrice.Text = DataGrid1.Columns(3).Text
:
: I have noticed that if the value is -1 if the check box is checked while a 0 is in the field for unchecked.
:
: Thank you in advance,
:
: Duane
:
:
the negative property value is from the -1
for check box's the following values apply:
1 = checked
0 = unchecked
hope it helps.
[blue]
C:Dos
C:Dos Run
Run Dos Run
[/blue]
: :
: : With frmInv2
: : .txtCode.Text = DataGrid1.Columns(0).Text
: : .txtCode.Locked = True
: : .txtDescription.Text = DataGrid1.Columns(1).Text
: : .chkWhsle.Value = DataGrid1.Columns(2).Value
: : .txtPrice.Text = DataGrid1.Columns(3).Text
: :
: : I have noticed that if the value is -1 if the check box is checked while a 0 is in the field for unchecked.
: :
: : Thank you in advance,
: :
: : Duane
: :
: :
: the negative property value is from the -1
: for check box's the following values apply:
: 1 = checked
: 0 = unchecked
:
: hope it helps.
:
: [blue]
: C:Dos
: C:Dos Run
: Run Dos Run
: [/blue]
:
:
How do I change the value from the computer generated 0 & -1? It appears to be stored in the database this way.
: : :
: : : With frmInv2
: : : .txtCode.Text = DataGrid1.Columns(0).Text
: : : .txtCode.Locked = True
: : : .txtDescription.Text = DataGrid1.Columns(1).Text
: : : .chkWhsle.Value = DataGrid1.Columns(2).Value
: : : .txtPrice.Text = DataGrid1.Columns(3).Text
: : :
: : : I have noticed that if the value is -1 if the check box is checked while a 0 is in the field for unchecked.
: : :
: : : Thank you in advance,
: : :
: : : Duane
: : :
: : :
: : the negative property value is from the -1
: : for check box's the following values apply:
: : 1 = checked
: : 0 = unchecked
: :
: : hope it helps.
: :
: : [blue]
: : C:Dos
: : C:Dos Run
: : Run Dos Run
: : [/blue]
: :
: :
: How do I change the value from the computer generated 0 & -1? It appears to be stored in the database this way.
:
If the checked value in the DB is -1, all you have to do is get the value and multiply it by -1 before passing it to the checkbox, that way you will get 1 and 0 instead of -1.
[blue]
C:Dos
C:Dos Run
Run Dos Run
[/blue]