date fields

J

Jo K.

I have two date bounded fields in a form.

DateA
DateB

I have two unbound text boxs (one overlapping the other - transparent
background setting) that will display a message as per below:

Textbox 1
If DateA is populated and DateB is empty then:
=IIf([DateA],'Assessment Report Submitted',"")

Textbox2
If DateB is populated and DateA is empty then:
=IIf([DateB],'Repairs Report Submitted',"")

Question: How can I have this text box display "Repairs Report Submitted"
when BOTH fields are populated with a date at the same time? What expression
can i use in the control source of this text box to get the desired outcome.
 
A

Allen Browne

Try:
=IIf([DateB] Is Null, IIf([DateA] Is Null, Null, "Assessment Report
Submitted", "Repairs Report Submitted")
 
J

Jo K.

I get a message indicating a wrong expression.


Allen Browne said:
Try:
=IIf([DateB] Is Null, IIf([DateA] Is Null, Null, "Assessment Report
Submitted", "Repairs Report Submitted")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jo K. said:
I have two date bounded fields in a form.

DateA
DateB

I have two unbound text boxs (one overlapping the other - transparent
background setting) that will display a message as per below:

Textbox 1
If DateA is populated and DateB is empty then:
=IIf([DateA],'Assessment Report Submitted',"")

Textbox2
If DateB is populated and DateA is empty then:
=IIf([DateB],'Repairs Report Submitted',"")

Question: How can I have this text box display "Repairs Report Submitted"
when BOTH fields are populated with a date at the same time? What
expression
can i use in the control source of this text box to get the desired
outcome.
 
D

Douglas J. Steele

I believe it should be

=IIf(IsNull([DateB]), IIf(IsNull([DateA]), Null, "Assessment Report
Submitted"), "Repairs Report Submitted")


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Jo K. said:
I get a message indicating a wrong expression.


Allen Browne said:
Try:
=IIf([DateB] Is Null, IIf([DateA] Is Null, Null, "Assessment Report
Submitted", "Repairs Report Submitted")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jo K. said:
I have two date bounded fields in a form.

DateA
DateB

I have two unbound text boxs (one overlapping the other - transparent
background setting) that will display a message as per below:

Textbox 1
If DateA is populated and DateB is empty then:
=IIf([DateA],'Assessment Report Submitted',"")

Textbox2
If DateB is populated and DateA is empty then:
=IIf([DateB],'Repairs Report Submitted',"")

Question: How can I have this text box display "Repairs Report Submitted"
when BOTH fields are populated with a date at the same time? What
expression
can i use in the control source of this text box to get the desired
outcome.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top