473,657 Members | 2,450 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 1969
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(chkContr olArray)
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(chkContr olArray)
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(chkContr olArray)
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
6162
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 values from a html form that consists of about 10 checkbox and a textbox where user have to key in a value to perform a search. From python tutors, I learned that I have to use the following method:
4
2045
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 on a 10k+ lines page and IE, looping through a form with 20k+ elements is VERY SLOW. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Documento senza titolo</title>
2
11786
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 me to access it. The funny thing is that it compiles fine, and the checkboxes are there, I just can't write to them! Is there a way around this problem? My HTML is as follows:
4
10409
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 to make disable color as the same before set enable = false Anyone can help me?????
8
4459
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 incorporate in my data access page. I have a numerical field called tier status and right next to it I have a checkbox. I would like to allow user to check and uncheck the checkbox as long as the tier
0
4092
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 with my problems. Now for my new little problem,I had a problem posting the values from checkbox fields to a database and thats the obstacle I overcame. Now the second part is my new problem is that I want that the next time that page loads for...
0
3105
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td colspan="2"><p>
3
5300
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 class="modalData" id="multipleCommSelect" style="padding: 50px;"> <center>Please select the communities from the list below:<br></center> <label><input name="CommID" value="3" type="checkbox">AIDS</label><br>
0
1702
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 have, I need to calculate number of checkbox I need to display. NumCheckBox = NumDepartments * 3 And then I need to create a table like structure with 4 fields. First column -Department Name and remaining 3 columns will be Monitor 1-3. and...
9
3331
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 name="spec2" type="checkbox" value="1" tabindex="12" /><label id="label">Building Construction</label></td> </tr> <tr>
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1971
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.