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!

Data Grid

Status
Not open for further replies.

Mukesh2375

Programmer
Jan 31, 2003
19
0
0
IN
I am using MSAccess as my database.
I want to display two columns in a datagrid say Name,Balance.
say there is a table with field CODE,NAME fields and
columns to show in datagrid NAME,BALANCE
where BALANCE field values to come from a function (say "Balance(CODE)") where i do some computation and then return the value. we pass the current recordset's CODE to 'Balance' and it returns a value.
can this be done? if yes how?
 
Try as a recordsource creating the temporary BALANCE field:

SELECT NAME , 0 AS BALANCE FROM TheTable

Now, you can loop through the records and update the column, record by record.

If possible, you could do the calculation in the SELECT statement:

SELECT NAME , AMOUNT*PRICE*1.04 AS BALANCE FROM TheTable

where AMOUNT and PRICE are existing fields in the table.

[/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top