|
 |
access thread: error in calculated text box...
Message #1 by "Darin Wray" <darin@r...> on Thu, 24 Jan 2002 22:05:02
|
|
Hey all,
I've got a little quirk that I can't figure out on a form. I'm using
an .adp file. There are 8 subforms on the main form (tab controls)The
subform has a text box that calculates the total sales...in
currency...related to an invoice number in the main form. I'm using the
value that's calculated in that text box to figure up some totals and
calculations in text boxes on the main form. Everything seems to work
fine when I'm looking at it...but, I have some reps telling my they are
seeing #ERROR# in the text box on the subforms...which affects the
calculations that are done on the main form, as well. It doesn't happen
all the time, tho.
Some of the subforms that are open don't have any records...thus the value
of the calculated text box for the individual subforms could be null. I
wrote an IIF statement for each of these boxes, like so...and, that's what
I made the control source for the calculated text box.
=IIF(IsNull([SalePrice]), 0, Sum([SalePrice])
That way, if there are no records in that particular subform, the value in
the control will be $0...and, I won't get any errors in my calculated
controls on the main form that reference these.
What could be causing the errors on the subform controls? These are reps
that are in remote offices, and accessing the internet via dialup
connections. I didn't know if that had anything to do with it...recordset
getting disconnected from a bad connection... Or, perhaps I need to be
refreshing or requerying the data in the subforms to keep from getting an
error, as they move thru the other subforms? The reps tell me that they
can see the records in the subform..and they can see the "SalePrice"
but..it's spitting out an error in the calculated text box.
I haven't been able to duplicate the error here...but, the SQL Server is
right next to me and hooked up to our network...thus, the reason I thought
it might be a connection issue.
Thanks in advance,
Darin
Hope
Message #2 by "David Chapman" <luckychap@b...> on Fri, 25 Jan 2002 20:11:42 +1030
|
|
Darrin,
I don't have an answer but I am in sympathy with you. I have had the same
problem in a networked Access 7 DB, although it has only one user.
I found the values on the subforms which were inside tab controls, sometime
picked up values from previous records. In different words, values
calculated in one subform could not be trusted to be used in another
subform, where both subforms are inside different tabs of a tabcontrol. A
stand alone version had the same problem.
The database stored and calculated the safe distance from an explosion of
different types and quantities of explosives. Common sense stuff made
complicated for boffins. It was a little used and very non critical - so I
did not need to find a solution. However I have been requested to modify it
so I will be watching for responses to your question.
David
----- Original Message -----
From: "Darin Wray" <darin@r...>
To: "Access" <access@p...>
Sent: Thursday, January 24, 2002 10:05 PM
Subject: [access] error in calculated text box...
> Hey all,
>
> I've got a little quirk that I can't figure out on a form. I'm using
> an .adp file. There are 8 subforms on the main form (tab controls)The
> subform has a text box that calculates the total sales...in
> currency...related to an invoice number in the main form. I'm using the
> value that's calculated in that text box to figure up some totals and
> calculations in text boxes on the main form. Everything seems to work
> fine when I'm looking at it...but, I have some reps telling my they are
> seeing #ERROR# in the text box on the subforms...which affects the
> calculations that are done on the main form, as well. It doesn't happen
> all the time, tho.
>
> Some of the subforms that are open don't have any records...thus the value
> of the calculated text box for the individual subforms could be null. I
> wrote an IIF statement for each of these boxes, like so...and, that's what
> I made the control source for the calculated text box.
>
> =IIF(IsNull([SalePrice]), 0, Sum([SalePrice])
>
> That way, if there are no records in that particular subform, the value in
> the control will be $0...and, I won't get any errors in my calculated
> controls on the main form that reference these.
>
> What could be causing the errors on the subform controls? These are reps
> that are in remote offices, and accessing the internet via dialup
> connections. I didn't know if that had anything to do with it...recordset
> getting disconnected from a bad connection... Or, perhaps I need to be
> refreshing or requerying the data in the subforms to keep from getting an
> error, as they move thru the other subforms? The reps tell me that they
> can see the records in the subform..and they can see the "SalePrice"
> but..it's spitting out an error in the calculated text box.
>
> I haven't been able to duplicate the error here...but, the SQL Server is
> right next to me and hooked up to our network...thus, the reason I thought
> it might be a connection issue.
>
> Thanks in advance,
> Darin
> Hope
|
|
 |