473,505 Members | 14,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checkbox help?

98 New Member
Now im using the check box to select the several items.In that I want to insert all the Checked items into the database by clicking one command button.So, how can I inset all the checked items into the database ?.So kindly ayone answer me with the example codings.
Feb 21 '07 #1
7 1964
hariharanmca
1,977 Top Contributor
Now im using the check box to select the several items.In that I want to insert all the Checked items into the database by clicking one command button.So, how can I inset all the checked items into the database ?.So kindly ayone answer me with the example codings.
just use control array and one for loop inside that usr your qury to insert or update
Feb 21 '07 #2
sreekandan
98 New Member
just use control array and one for loop inside that usr your qury to insert or update
I have no idea about that, So please send me the example codings.
Feb 21 '07 #3
hariharanmca
1,977 Top Contributor
I have no idea about that, So please send me the example codings.

copy and past the check box and it will ask for create array give yes and use this type of code.


Private Sub Command1_Click()
Dim i As Integer
For i = 0 To UBound(chkControlArray)
If chkControlArray(i).Value = Checked Then
'Your Qry
End If
Next i
End Sub
Feb 21 '07 #4
sreekandan
98 New Member
copy and past the check box and it will ask for create array give yes and use this type of code.


Private Sub Command1_Click()
Dim i As Integer
For i = 0 To UBound(chkControlArray)
If chkControlArray(i).Value = Checked Then
'Your Qry
End If
Next i
End Sub
I have written the following code
Expand|Select|Wrap|Line Numbers
  1.  Private Sub Command2_Click()
  2. Dim i As Integer
  3. For i = 0 To UBound(chkControlArray)
  4. If chkControlArray(i).Value = Checked Then
  5. con.Execute "insert into Table(t1)values('" & List1.Selected & "')"
  6. End If
  7. Next i
  8. End Sub
But the compile error occured as "Argument not optional".
So kindly reply me
Feb 21 '07 #5
hariharanmca
1,977 Top Contributor
I have written the following code
Expand|Select|Wrap|Line Numbers
  1.  Private Sub Command2_Click()
  2. Dim i As Integer
  3. For i = 0 To UBound(chkControlArray)
  4. If chkControlArray(i).Value = Checked Then
  5. con.Execute "insert into Table(t1)values('" & List1.Selected & "')"
  6. End If
  7. Next i
  8. End Sub
But the compile error occured as "Argument not optional".
So kindly reply me

where its showing that error
Feb 21 '07 #6
sreekandan
98 New Member
where its showing that error
while run that program that error is showing
Feb 21 '07 #7
hariharanmca
1,977 Top Contributor
while run that program that error is showing

Private Sub Command2_Click()
Dim i As Integer
For i = 0 To UBound(chkControlArray)
If chkControlArray(i).Value = Checked Then
con.Execute "insert into Table(t1)values('" & List1.Selected & "')"
End If
Next i
End Sub

You gave
list1.Selected
its need selected index
list1.Selected(index)
Feb 21 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
6142
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
4
2029
by: Fabri | last post by:
How can I, on button click, to select ONLY the following 4 checkbox? I would like to do this without a for loop through form.lenght because this is only an example and I have to apply this script...
2
11760
by: Thomas R | last post by:
Is is possible? In VS.NET 2003, Binding data to the repeater is easy, but when I try to add an ASP:checkbox to the .aspx page, the designer won't recognize it, hence the code view doesn't allow...
4
10385
by: Matrixreloadedth | last post by:
How to change disable color of Checkbox??? I have a checkbox with forecolor in red but when i disable by set Enable properties to false forecolor is changed to gray color but i don't want it. how...
8
4449
by: Sid | last post by:
I hope someone could help me with this. I am trying to setup a criteria to decide when to allow/not allow user to click on the check box. logically it looks simple but I am not able to...
0
4078
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
0
3089
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
3
5293
realin
by: realin | last post by:
Hiya all, i am in deep trouble, i thought it was an easy task, but now its getting on my nerves. Well i have a div on a form, which contains a number of checkboxes, as <div...
0
1694
by: remya1000 | last post by:
I have a field called Departments in my database. and I have 3 monitors. So when Page_Load, I need to check number of departments I have in database. And depends upon that number of departments I...
9
3318
by: raamay | last post by:
I have six checkboxes as shown below: <table> <tr> <td><input name="spec1" type="checkbox" value="0" tabindex="11" /><label id="label">Bridge Construction</label></td> </tr> <tr> <td><input...
0
7216
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4699
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.