Calculated Text Box

G

Guest

Hi

I have created a text box on a form in which I have put the following
formula in the "data" field in the properties.

=IIf([NEXTB]>=([B Service]+42),"Overdue for B Service","")

[NEXTB] is also a calculated text box (=[Service B]+42) Service B is date
field.

What I am trying to acheive is if the date in [NEXTB] is greater than
([Service B]+42) then it should display Overdue for Service or it should
display nothing, however it is diplaying the message whether it's greater
than ([Service B]+42) or not.


What have done wrong???
 
A

Allen Browne

Access may not be understanding [B Service]+42 to be a date.

Try using DateAdd():
=IIf([NextB] >= DateAdd("d", 42, [B Service]), "Overdue for B Service",
Null)
or perhaps typecasting:
=IIf([NextB] >= CVDate([B Service] + 42), "Overdue for B Service", Null)
 

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