A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error on form



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2004, 03:14 PM
CS
external usenet poster
 
Posts: n/a
Default #Error on form

I have a calculated field on a form that requires input
from another field to perform the calculation. If the
input is blank, the calculated field shows #Error. Is
there a way to just have it stay blank if the input field
does not have data?
  #2  
Old June 4th, 2004, 04:00 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default #Error on form

It's a matter of finding out what caused the error.

Take this example:
=DLookup("ID", "MyTable", "SomeNumberField = " & [SomeControl])

If SomeControl is Null, the 3rd argument becomes just:
SomeNumberField =
which is a nonsense, and generates the #Error. To avoid that situation, use
Nz() to supply some numeric value, e.g.:
=DLookup("ID", "MyTable", "SomeNumberField = " & Nz([SomeControl],0))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"CS" wrote in message
...
I have a calculated field on a form that requires input
from another field to perform the calculation. If the
input is blank, the calculated field shows #Error. Is
there a way to just have it stay blank if the input field
does not have data?



  #3  
Old June 4th, 2004, 04:07 PM
hcj
external usenet poster
 
Posts: n/a
Default #Error on form

Hi CS,
try this in your calculated field:
=IIF(isnull(sourcefield),"",calculation)

Hope this works for you

-----Original Message-----
I have a calculated field on a form that requires input
from another field to perform the calculation. If the
input is blank, the calculated field shows #Error. Is
there a way to just have it stay blank if the input field
does not have data?
.

  #4  
Old June 7th, 2004, 05:12 PM
CS
external usenet poster
 
Posts: n/a
Default #Error on form

Thanks hcj and Allen. Looks like this will work.
-----Original Message-----
Hi CS,
try this in your calculated field:
=IIF(isnull(sourcefield),"",calculation)

Hope this works for you

-----Original Message-----
I have a calculated field on a form that requires input
from another field to perform the calculation. If the
input is blank, the calculated field shows #Error. Is
there a way to just have it stay blank if the input

field
does not have data?
.

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.