Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends
I am Sarfaraz. Friends I am working on a billing project in VB6 and access. I have to save the information of a client like Id, Account No, name etc and most important Items(from a combo box) and then based on that combo box item select type of item from another combo box and finally length and width of that item and save them in a database.

I have done that but the client can ask for more than one item and I want to keep his A/c no and other details same . how can I do that I need some guidance in it.
Also his billing details like credit amount, debut amount and balance should be searched by his A/c no.

To save the details for single Item and type of item i have used the following code which is working correctly but now how to save second item of the same client having without changing his A/c no.
VB
Connection
sql = "customers"
rs.Open sql, Con, adOpenDynamic, adLockOptimistic

With rs
                    .AddNew
                   .Fields("account_no") = "DM-" & txtid.Text
                   .Fields("cus_name") = txtname.Text
                    .Fields("cus_address") = txtaddress.Text
                       .Fields("contact_no") = txtcontact.Text
                    .Fields("email") = txtemail.Text
                     .Fields("item") = cmboitems.Text
                      .Fields("type") = cmbotype.Text
                       .Fields("length") = txtlength.Text
                        .Fields("width") = txtwidth.Text
                         .Fields("Amount") = txtlength.Text * txtwidth.Text * txtrate.Text
                  
                    .Update
                    .Close
                     Con.Close
   End With
                     
   MsgBox "Data has been successfully Added into the Database, Please Proceed", vbInformation, "INFORMATION"

Thank you
Posted
Updated 16-May-13 21:59pm
v2
Comments
Sergey Alexandrovich Kryukov 17-May-13 2:23am    
You main goal is to keep in secret that the product was written in VB6, otherwise the customers would be too afraid to trust their money. :-)
—SA
Richard MacCutchan 17-May-13 4:02am    
I agree with Sergey Alexandrovich's comments. Forget VB6 and start using a modern language that is supported, and not one that is old and dead. Get hold of some good documentation on Databases/SQL.
sarfarazbhat 17-May-13 4:55am    
Ok guys thank you.
Need some good prog videos or links for VB.net and Mysql

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900