473,799 Members | 3,866 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Store a Listbox Items in Ms Access Db

23 New Member
Hi All
I am working on a project in which i have to face a problem. In my project I have Three listboxes and I want to store these listboxes Items in MS Access database. I don't know how to do this.
can any one help me
Feb 2 '07 #1
5 3760
hariharanmca
1,977 Top Contributor
Hi All
I am working on a project in which i have to face a problem. In my project I have Three listboxes and I want to store these listboxes Items in MS Access database. I don't know how to do this.
can any one help me
You can storethe items by running for or while loop with the list count
(Give bref detail about that)
Feb 2 '07 #2
SandeepJagdeva
23 New Member
Thanx for Reply

I give you some details:
My project is Making a VAT-Invoice. In this invoice there are Three fields with listbox e.g. 'Sr. No', 'Item Discription', and 'Quantity'. I use Three textbox to enter Values in listbox and a Command Button Name 'ADD'. When user fill all three textboxs and click on 'Add' Button all items add to listboxes. Its OK till now, But Now I have to Store all these three Listboxes items to MS database. I am confuse here, how to do this. And I am also confuse here that What type of field I have to choose in database to store these listbox Items.
Plz Help me. If u can. Send Example code if u can. Thanx.
Feb 2 '07 #3
hariharanmca
1,977 Top Contributor
Thanx for Reply

I give you some details:
My project is Making a VAT-Invoice. In this invoice there are Three fields with listbox e.g. 'Sr. No', 'Item Discription', and 'Quantity'. I use Three textbox to enter Values in listbox and a Command Button Name 'ADD'. When user fill all three textboxs and click on 'Add' Button all items add to listboxes. Its OK till now, But Now I have to Store all these three Listboxes items to MS database. I am confuse here, how to do this. And I am also confuse here that What type of field I have to choose in database to store these listbox Items.
Plz Help me. If u can. Send Example code if u can. Thanx.

why don't you use ListView than listbox...?
you can save with single for or while loop in that list view
Feb 2 '07 #4
hariharanmca
1,977 Top Contributor
Thanx for Reply

I give you some details:
My project is Making a VAT-Invoice. In this invoice there are Three fields with listbox e.g. 'Sr. No', 'Item Discription', and 'Quantity'. I use Three textbox to enter Values in listbox and a Command Button Name 'ADD'. When user fill all three textboxs and click on 'Add' Button all items add to listboxes. Its OK till now, But Now I have to Store all these three Listboxes items to MS database. I am confuse here, how to do this. And I am also confuse here that What type of field I have to choose in database to store these listbox Items.
Plz Help me. If u can. Send Example code if u can. Thanx.
Private Sub cmdAdd_Click()
lvItemList.List Items.Add lvItemList.List Items.Count + 1, , txtSerialNo
lvItemList.List Items(i).SubIte ms(1) = txtDesc.Text
lvItemList.List Items(i).SubIte ms(2) = txtqty.Text
End Sub


Private Sub cmdOk_Click()
For i = 1 To lvItemList.List Items.Count
strSql = ""
strSql = "insert into tblTaxInvoiceDe tail (Slno,Desc,Qty) values(" & Val(lvItemList. ListItems(i).Te xt) & ",'" & lvItemList.List Items(i).SubIte ms(1) & "'," & Val(lvItemList. ListItems(i).Su bItems(2)) & ")"
conn.Execute strSql
Next i
End Sub
Feb 2 '07 #5
SandeepJagdeva
23 New Member
Thanx for Codes
I will Try that and tell you my results

Have A Nice Day
Feb 2 '07 #6

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

Similar topics

3
5309
by: Alan Lane | last post by:
Hello world: I have a Parent form with a combobox, where the user selects a Contract or Estimate number. Then, on a subform, I have a listbox that gets filled with the details of the selected Contract. The subform listbox shows 21 rows. That has been fine, but now we are starting to get some Contracts or Estimates with more than 21 items.
2
1765
by: xzzy | last post by:
I have an app that uses a listbox to display program status messages, and a public function to be used by the solution to update the listbox. I do not know how to make the listbox public so it can be updated by that function. public class frmMain : System.Windows.Forms.Form{ public System.Windows.Forms.ListBox listBox1;
6
2884
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
1
2272
by: yamne | last post by:
I have a problem. When I click in edit datagrid button I show two listbox and two button. I use two button to move data between two listbox. My problem is that I can't call the listbox in the button_click function because the only way to find the listbox is: (listbox)e.item.findcontrol What s the solution to this problem?
3
2730
by: Ryan Taylor | last post by:
Hello. I have an application where I need the user to be able to add items to a listbox. I've implemented this via javascript. The listbox is an <asp:ListBox>. However, when the user submits the form those items do not get posted. My listbox.Items.Count always returns 0. I want the user to be able to add items without having to resort to a postback, hence the javascript. But I need to be able to access those items in the code behind...
1
2886
by: JMann101 | last post by:
I am writing a ASP.NET(VB) application and am having some trouble. I have a datagrid which list users and when an admin clicks "edit" a defined column becomes visible and a dynamic listbox control is added to that column/row. When the admin clicks "update" I am unable to retrieve the values that were selected from that listbox. Basically, This is a multi-select listbox, so I need to loop to pull all selected items. This is the only...
3
3306
by: thomasp | last post by:
Has anyone got some sample code to do drag and drop from one listbox to another listbox using VB.Net 2005. The below code works for draging and droping one at a time, but not for multiselected items. I tried setting up an array to capture the selected items and then move them with the dragndrop code, but after selecting the items when the user clicks on the items to drag them the selection goes back to one item. Also I have code for the...
1
4033
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set. when i tried to use a remove item code it worked fine, it did delete the item form the list but it added...
5
2856
by: Academia | last post by:
(If you've seen this in the drawing NG, sorry. I inadvertently sent it there.) I have a listbox populated with Objects. The Class has a String field that ToString returns. I assume that is what the ListBox uses for its display. Correct?
8
15444
by: jh | last post by:
I'd like to copy/paste into a listbox during runtime. I can do this for a textbox but can't figure out how to accomplish this for a listbox. Any help? Thanks.
0
9543
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
10488
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...
1
10237
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
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5467
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...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.