subform calculation help needed

wannabepro

Registered User.
Local time
Today, 00:38
Joined
Jan 25, 2005
Messages
102
I have a subform, which is in datasheet mode. In that subform I have a drop down menu (combo box), and then I have 3 different fields where the value will be written. e.g. Assets, Liabilities, and Equity. Assets and Liabilities will written down by the user, but Equity has to be calculated automatically by subtracting Assets and liabilities. And, I m having so much problem with that. This subform was created through a query.

Desperatly in need of help. :(
 
In the afterupdate of your assets and also in the afterupdate of your liabilities, code it as follows:

Me.Equity = Me.Assets - Me.Liabilities.

I believe that is all you have to do, if I understand your problem correctly.
 
Pat Hartman said:
Modify the query to do the calculation.

Select Assets, Liabilities, Nz(Assets,0) - Nz(Liabilities,0) As Equity
From YourTable;

Thanks Pat Hartman, :( Its still not working. I have attached the jpg img of the datasheet. Probably, it might be helpful in my query. Its hard to do it, because values are in text boxes and the text is in combo box.


edtab thanks, but I can't seem to do that cuz of the combo box.
 

Attachments

  • datasheet.JPG
    datasheet.JPG
    46.5 KB · Views: 195
SELECT [Final Stages].[Dec 31st Year End], [Final Stages].[Borrower In House], [Final Stages].[Borrower In House1], [Final Stages].[Borrower In House2], [Final Stages].Guarantor2, [Final Stages].[Loan ID2]
FROM Financial INNER JOIN [Final Stages] ON Financial.[Dec Year End] = [Final Stages].[Dec 31st Year End];


This is the Query that i m using to create the subform.
 
The subform contents you posted doesn't seem to correspond to the query you said you used to create it.

Perhaps you can zip your database and e-mail it to me and I'll see if I can help you any further. Send it to edtab@hotmail.com
 
I know its pretty confusing, I am sorry. I kind of don't know how to explain it. Proly u will be able to sort it out, once u look at it. I have emailed you, hopefully you will be able to help me out.

Thank you so much :)
 
I did not get your zipped db. Afraid can't help you without that.
 
edtab said:
I did not get your zipped db. Afraid can't help you without that.

arghhhhhhh, i sent that yesterday, and i was expecting to see some positive ans today :(, hotmail wont let me send that and i think that is the reason you are not recieving it. Can you give me yahoo address plz or some other adds.
 
Please unzip attached file. I'm sure you can follow it.
 

Attachments

Etab, thanx for the reply and database. But, this will not do it, there is a reason of using the datasheet and those values there and the combo box. It will kill the purpose, if I use it in this manner. I have already done it like this. But, sadly it will not serve it :( I wanted a vb code or way to subtract the values. In the same fashion as I have jot them down. I know that combo box is the only problem, but I can't remove it.


Proly, I wont get any help :(
 
I agree. . .redesign. . .I took a look at it today and found everything Pat Hartman is talking about. I think it will be beneficial to you to redesign WITH "PKs" and relationships inset. :) Just my 2 cents
 
Thanx guys :)

I have recreated the whole thing. But my question still remain, is it possible to have calculation using the combo box. How can I possibly divide/multiply/Subtract values, when text which is representing the value are in combo box, while the values are in text box. I am talking about the Dec 31st year end subform.
 

Users who are viewing this thread

Back
Top Bottom