help with functions plz

rogue

New member
Local time
Today, 05:29
Joined
Aug 26, 2002
Messages
7
Thx in advance to all. Ok this is what im trying to do- I’m keeping track of a client list with excel but im defiantly out-growing it so i moved the data over to access but I would like to add a function to one of the forms which is the following:
In the excel worksheet ill use these cells as examples:
1.”total_due”
2.”total_paid”
3.”total_bal”
4.”bal_status”

Just looking at the cell labels it self-explanatory, in the ”total_bal” cell, I added a auto sum function to give me total from ”total_due & total_paid” cells to show a balance. Now in the ”bal_status” cell I added a true or false function- if the balance was 0 then a “P” would show in the ”bal_status” cell, anything other than 0 then a “U” would show.

I would like to still do this with a form, could someone show me how to do this.
I tried using the follow code but it didnt work like I wanted it to:

If total_bal = “0” then
bal_staus = “P”
else
bal_staus = “U”

can anyone help out with this code and the autosum code to get a balance before the form saves the data?
Thx again
 
in the control source for the bal_staus use

=IIF(total_bal=0,"P","U")
 
but now the text field shows "#Name"
 
K I fixed the typo. this works but it doesnt record the data.
 
Normally, it's not a good idea to save a calculated field to a table. Why do you feel you need to save "P" or "U" in your table?
 
Unless you have reason to record an account's status on a specific date as a historical thing, there is no reason to store an account's status. Compute this only within a query or display it only within a form or report.

If you MUST record an account's historical status, you need to include a date field in this table for each user record.
 
charityg said:
Normally, it's not a good idea to save a calculated field to a table. Why do you feel you need to save "P" or "U" in your table?

one of the reports will need to show the paid/unpaid status (its one of those things to make the bossman happy) :D
 
Put the calculated field on the report, or use vba on the Print Event
If Me.MyTotal=0 Then
My.MyField ="P"
Else
Me.MyField="U"
End If
 

Users who are viewing this thread

Back
Top Bottom