Writing expressions for a report

emcc

Registered User.
Local time
Today, 09:40
Joined
Dec 14, 2000
Messages
10
I'm a fairly new Access user (self-taught)and have created a report where, in one field I would like to have Access look at one date field and compare it to another and make a decision on what it finds. Specifically, I'm trying to say:

if InvoiceDate is Null, print the QuoteDate, otherwise leave this field blank

and this is the expression I used:

=IIf(IsNull([InvoiceDate]),[QuoteDate], " ")

In the field, in print preview, I get the message #Error.

I'm not sure if I've used the right expression, if I have spaces where I shouldn't or vice versa or if I'm even doing this in the right place. I thought maybe this would be better done in VB and I do have some VB experience but I'm not sure where you would code VB in Access.

Can anyone help???
 
I have all of my expressions in Text Boxes...
 
The only problem I can see is the space between quotes should be ""
 
Make sure that the name of the text box that contains the expression is not the same as the name of any column from the report's recordsource. If the report wizard built the form and the control where you have the expression was originally the InvoiceDate or QuoteDate field, the control name is probably InvoiceDate or QuoteDate - change it.
 
Pat -

Thank you, thank you, thank you...that was the problem. You have no idea how long I have struggled with this or how many people I have asked about this!

I am so glad I found this site!!!
 

Users who are viewing this thread

Back
Top Bottom