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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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 | |
|
|