Hi all,
I'm trying use the Ledger template from Access 2003.
In the Accounts form, the "Account Balance" field contain the following
error: "#Name?". Why?
The control source is
=IIf([Accounts Subform].Form.RecordsetClone.RecordCount=0,0,[Accounts
Subform].Form!Balance)
and it seems that this code don't function properly.
Someone can help me?
Thanks
Alberto.
------------------------------------------------
Howhiareu - 13 Jan 2004 18:11 GMT
is there any data in the system yet? Null values can produce that
condition when a field tries to evaluate a null value.
There is one way to try getting aroud this.
Put that line in a private form function something like this:
private function EvalBalance() as variant
------------------------------------------------
Howhiareu - 13 Jan 2004 18:15 GMT
is there any data in the system yet? Null values can produce that
condition when a field tries to evaluate a null value. It may go away
as soon as there is a record added to the table.
There is one way to try getting aroud this.
Put that line in a private form function something like this:
private function EvalBalance() as variant
Dim Temp as variant
on error resume next
Temp = "0"
Temp=IIf([Accounts
Subform].Form.RecordsetClone.RecordCount=0,0,[Accounts
Subform].Form!Balance)
EvalBalance=Temp
on error goto 0
end function
then update the control source of that field like this:
=EvalBalance()
variants can return null values, while strings wont do it gracefully in
a situation like this. Also, this method allows you to monitor and
control an error state.
------------------------------------------------
virtualkeeper - 18 Oct 2006 22:48 GMT
Howhiareu, thanks for solving a bug that drove me crazy for an hour or so.
Appreciate it and that worked great. This is the only solution available that
I found on the Internet and this being one of only two mentions of the
problem I could find. To clarify for future users, open the Form_Accounts
class object and paste this in (what is below) below the last line of code
entry. The breaks in the previous code, due to e-mail wrapping, might stump
someone less inclined.
Private Function EvalBalance() As Variant
Dim Temp As Variant
On Error Resume Next
Temp = "0"
Temp = IIf([Accounts Subform].Form.RecordsetClone.RecordCount = 0, 0,
[Accounts Subform].Form!Balance)
EvalBalance = Temp
On Error GoTo 0
End Function
Then in the properties box where the previously held crappy script was, put
=EvalBalance()
Hopefully that clarifies it for future newbies like myself.

Signature
Later,
Darrin
virtualkeeper - 18 Oct 2006 22:49 GMT
Sorry, wasn't e-mail wrapping, it was this layout. Make sure that after 0,0
it continues in one line with what is shown on the next line.

Signature
Later,
Darrin