check out the code below
the txtGender.Text is databound,
when i execute it with a record contains value "m", the messages shows "m". and the the radiobutton "RBMale" is suppose to be checked. however, it wasn't.
is it because on the frmUserRegistration, i have databound fields, which affected the radiobuttons? i tried the same code on another form which doesn't have databound fields, it workd perfectly.
can anyone help plz?
VB.NET:
MsgBox(ModuleUser.frmUserRegistration.txtGender.Text)
'get gender field value for display
If ModuleUser.frmUserRegistration.txtGender.Text = UCase("m") Then
'check male radiobox when user is a male
ModuleUser.frmUserRegistration.RBMale.Checked = True
ModuleUser.frmUserRegistration.RBFemale.Checked = False
ElseIf ModuleUser.frmUserRegistration.txtGender.Text = UCase("f") Then
'check female radiobox when user is a female
ModuleUser.frmUserRegistration.RBMale.Checked = False
ModuleUser.frmUserRegistration.RBFemale.Checked = True
Else
'gender is not specified, leave both radioboxes empty
ModuleUser.frmUserRegistration.RBMale.Checked = False
ModuleUser.frmUserRegistration.RBFemale.Checked = False
End If
when i execute it with a record contains value "m", the messages shows "m". and the the radiobutton "RBMale" is suppose to be checked. however, it wasn't.
is it because on the frmUserRegistration, i have databound fields, which affected the radiobuttons? i tried the same code on another form which doesn't have databound fields, it workd perfectly.
can anyone help plz?