Manipulating Data in Form

  • Thread starter Thread starter Alan Wansboro
  • Start date Start date
A

Alan Wansboro

In form view I have a field (MARISTAT) populated with
either a 1 or 2 (1 = Married, 2 = Single). I also have a
field populated with a date (to represent a future
date). I want another field (the one I am having
problems with) to add 17 days to the date field ONLY if
the MARISTAT field is input with '1' and not '5'. I've
tried everything but do not know what question to ask the
online help to find the solution. Can anyone help me
please?

Al
 
In the field's control source, build an IF statement like...

=IIf([MARISTAT]=1,[DateFieldName]+17,"")


Rick B


In form view I have a field (MARISTAT) populated with
either a 1 or 2 (1 = Married, 2 = Single). I also have a
field populated with a date (to represent a future
date). I want another field (the one I am having
problems with) to add 17 days to the date field ONLY if
the MARISTAT field is input with '1' and not '5'. I've
tried everything but do not know what question to ask the
online help to find the solution. Can anyone help me
please?

Al
 
The dateadd would work. I have a query where I am pulling Date()-7 so I
assumed you could do it as long as the data is formatted as a date.

But, I would think the dateadd would be a more elegant way. It just needs
to be inside the IF statement.

Good point.

Rick

Hey Rick sorry to ask this but can you do that because Date is not a number
so adding 17 to it would not do anything

but wouldnt you use
DateAdd("d",17,[DateToBeAddedToo]) inside the if statement
 
Rick,

I'm obviously an Access 'newby' and want to thank you very
much for your response. However, where is says
[DateFieldName] am I to substitute the FieldName part to
read the name of the field I wish to add to? ie
DateLSSAStart (the name of mt field). It's probably a
lame question for an experienced user such as yuorself! I
think I'll stick to a notebook and pencil (and eraser).

Al
 
Rick, Brandon. You're both right. I was a bit daunted b
the IIf statement, but it works. Thanks again guys, the
boss loves me!!
 
Back
Top