Hello
my tables have a column type varchar(5)
value = 10100
on a form I created five checkbox control
corresponding to the value in column
if the value =1 checkbox= true
and vice versa, the value = 0 checkbox = false
how I can upload the data forms correctly
by any code to help.
thanks a lot
fugio 0 Newbie Poster
Recommended Answers
Jump to PostYou can do
Dim val As String = "10010" For i As Integer = 0 To 4 Dim cbx As CheckBox = Me.Controls("CheckBox" & i) cbx.Checked = val.Substring(i - 1, 1) = "1" Next
Just replace the
Dim
statement with the statements to retrieve the …
Jump to Post@Sanu - note that
Me.Controls("CheckBox" & i)
will directly reference the control (but it has to be cast to CheckBox first).@fugio - you have two examples here that do what you seeem to be asking. If you don't understand something specific please ask instead of just posting code.
All 5 Replies
Santanu.Das 125 Santanu Das
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
fugio 0 Newbie Poster
Santanu.Das 125 Santanu Das
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Santanu.Das commented: Thanks for pointing out an unnecessary loop of controls. +6
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.