473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Store a Listbox Items in Ms Access Db

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 3737
hariharanmca
1,977 1GB
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
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 1GB
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 1GB
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.ListItems.Add lvItemList.ListItems.Count + 1, , txtSerialNo
lvItemList.ListItems(i).SubItems(1) = txtDesc.Text
lvItemList.ListItems(i).SubItems(2) = txtqty.Text
End Sub


Private Sub cmdOk_Click()
For i = 1 To lvItemList.ListItems.Count
strSql = ""
strSql = "insert into tblTaxInvoiceDetail (Slno,Desc,Qty) values(" & Val(lvItemList.ListItems(i).Text) & ",'" & lvItemList.ListItems(i).SubItems(1) & "'," & Val(lvItemList.ListItems(i).SubItems(2)) & ")"
conn.Execute strSql
Next i
End Sub
Feb 2 '07 #5
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
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...
2
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...
6
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...
1
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...
3
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...
1
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...
3
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...
1
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...
5
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...
8
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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
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,...

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.