473,405 Members | 2,167 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,405 software developers and data experts.

calculate sum of all record valyee of column & display in vb form

1
I have an ms access database with table xyz in that there arre three coulmn .i want to do addition of my first column value . & that addition i want to display in vb 6.0 form which having one text box
Oct 12 '12 #1
1 3885
smartchap
236 100+
You can do it easily using DAO.
After opening database use following code to see the result in a text box (modify as per your requirement):
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.     'MsgBox rs.Fields("Col1").Value
  3.     rs.MoveFirst
  4.     For i = 1 To rs.RecordCount
  5.         Text1.Text = Val(Text1.Text) + Val(rs.Fields("Col1").Value)
  6.         rs.MoveNext
  7.     Next
  8.  
  9. End Sub
  10.  
Oct 16 '12 #2

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

Similar topics

0
by: Ronan | last post by:
Hi, I have a problem with a form using the PHP PEAR HTML_QuickForm package & javascript: I want to record the content of my form into a mySQL database then execute a javascript function. ...
4
by: Just Me | last post by:
I'm trying to place an "ADD" button in a form to allow the user to add records to a table. I'm using DAO. For some reason, the record gets added, but the form doesn't point to it. In addition,...
4
by: amywolfie | last post by:
I've been trying to do something for about 3 days – I get close, but not 100%. I am trying to: Open frmRevisionHistory from a button on frmFeeInput. If there is NO RELATED RECORD, then I...
9
by: Sandy | last post by:
Hi all, I have a form to list records (frmListIssue) which I call from different other forms. My wish is to display a message when the form is called and empty; no records to display. I want to...
1
by: Simon | last post by:
Dear reader, How can I move the record pointer in a sub form. The sub form is a datasheet type. Both forms have the same reference key. How can I move the record pointer in the sub form...
7
by: hjohnson | last post by:
Within the access environment, I have a table that I'd like to -add a column -place the record number of each record into that column The autonumber is not working for me because I am...
2
by: AA Arens | last post by:
I have a form with a combo account manager (choose the name) I have record navigation buttons on that form, along with other fields. I do not use queries, only tables. One of the tables is the...
2
by: vinceboy | last post by:
Hi anybody. I am newbie here and would like to know that how can I validate both drop down menu and radio button from a dynamic display form.Something went wrong with my script.The radio button is...
2
by: Dave | last post by:
Access 2003 I have an unbound search form, which shows filtered search records in it’s sub-form. On the unbound search form I wish to place a button, which will close off the search form, and...
3
Jerry Maiapu
by: Jerry Maiapu | last post by:
Hi all, I have a child and parent forms. The record source of the sub-form is query containing aggregate functions. A combo box in the parent form filters the sub-form results based on value...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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
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...
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.