Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a column of data

Status
Not open for further replies.

scrappe7

Technical User
Jul 30, 2001
82
0
0
US
hello all,

I have developed a DB that imports and excel file of financial data, which will occur daily. i then have a query that finds the unique entries in the DB. the user is able to go to a form and select the account # the wish to view. all unique transactions then appear based on the acount # selected from a list box. this is all working properly.

what i need to insert is another column that will display the sum of all the credits/debits FOR EACH INDIVDUAL number. i've tried the wizard but the sum that is returned is not for the selected account number. when a user uses the form to find all transactions for account #123, all the info should be displayed with a column at the end that displays a total for the currently viewed data. how is this done? step by step details would be great;y appreciated as my access skills are not great. thank you veyr much.

Ed
 
Are you displaying a query datasheet to the user or are you showing the value in say a listbox on the form or something else? There are at least two ways to do it, one being a subquery, the other being the dsum function.

If you're doing a query datasheet the subquery is the best option (ditto if your putting a listbox on a form). If you're displaying the total in a textbox the DSum route probably the easier way to go. Joe Miller
joe.miller@flotech.net
 
The form has a button that runs a macro which in turn is running the query. the data is presented tot he user in a data sheet view. So i take it the sub query should be used. just how would i go about doing that? thanks
 
The best example of a subquery is to look it up in the online help. They give a very simple example that is very similar to exactly what you are doing. If you can't figure it out after trying it let us know.

Joe Miller
joe.miller@flotech.net
 
Sorry joe but im not clear on how they are doing it. what i did was added a column with my existing query and then in the criteria row i entered =sum(credit), i figure there has to be more to it than this because it won't work. thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top