Take alook it was re assigning it unchecked in the second if statement.
If objDataReader("PrimaryDebtorSavingsAccount") = "yes" Then
'Text 5
PrimaryDebtorSavingsAccount.Checked = True
Else
PrimaryDebtorSavingsAccount.Checked = False
End If
If objDataReader("PrimaryDebtorCheckingAccount") = "yes" Then
'Text 5
PrimaryDebtorSavingsAccount.Checked = True
Else
PrimaryDebtorSavingsAccount.Checked = False
End If
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Belcher
Sent: Thursday, November 10, 2005 5:32 PM
To: [email protected]
Subject: [AspNetAnyQuestionIsOk] Checkbox set dynamically in code.
Hi, I have a page were depending on the values pulled from a table the
checkbox is CHECKED or NOT CHECKED. Seems simple and should be but its not
checking them. I have tested this code and it works all except the checkbox
getting checked when the value is yes. Even when it is yes and the if
statement runs the command PrimaryDebtorSavingsAccount.Checked = True for
example does not check the box on the form. All the other text boxes etc get
the right values but the check boxes don't seem to get checked when they
should be. Anyone know why?
MIKE
If objDataReader("PrimaryDebtorSavingsAccount") = "yes" Then
'Text 5
PrimaryDebtorSavingsAccount.Checked = True
Else
PrimaryDebtorSavingsAccount.Checked = False
End If
If objDataReader("PrimaryDebtorCheckingAccount") = "yes" Then
'Text 5
PrimaryDebtorSavingsAccount.Checked = True
Else
PrimaryDebtorSavingsAccount.Checked = False
End If
If objDataReader("PrimaryDebtorCreditCard") = "yes" Then 'Text 5
PrimaryDebtorCreditCard.Checked = True
Else
PrimaryDebtorCreditCard.Checked = False
End If
If objDataReader("PrimaryDebtorHomeLoan") = "yes" Then 'Text 5
PrimaryDebtorHomeLoan.Checked = True
Else
PrimaryDebtorHomeLoan.Checked = False
End If
If objDataReader("PrimaryDebtorPersonalLoan") = "yes" Then 'Text
5
PrimaryDebtorPersonalLoan.Checked = True
Else
PrimaryDebtorPersonalLoan.Checked = False
End If
If objDataReader("PrimaryDebtorAutoLoan") = "yes" Then 'Text 5
PrimaryDebtorAutoLoan.Checked = True
Else
PrimaryDebtorAutoLoan.Checked = False
End If
'Check Boxes
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/