Setvalue

  • Thread starter Thread starter Mark Hubbard
  • Start date Start date
M

Mark Hubbard

I am trying to use a macro to set the value of a date field(field A) to
be 90 days later than either field B or field C. I tried a conditional
setvalue expression like so:
If([Forms]![TheForm]![Field B]="Is Not Null",DateAdd("d",90,[Field
B]),DateAdd("d",90,[Field C]))
the item in the macro is field A.
I continue to get an error that say "The expression you entered has a
function name that Microsoft Access can't find"
Any ideas on why this is happening are greatly appreciated.
 
try

IIf(

instead of

If(

also, does Field B really have a text value of "Is Not Null"? or do you mean
to say "If Field B is not null, add 90 days to Field B, otherwise add 90
days to Field C" ? if the latter, suggest you try

IIf([Forms]![TheForm]![Field B] Is Not Null, DateAdd("d",90,[Field
B]), DateAdd("d",90,[Field C]))

hth
 
Bingo....Thanks!!
try

IIf(

instead of

If(

also, does Field B really have a text value of "Is Not Null"? or do you mean
to say "If Field B is not null, add 90 days to Field B, otherwise add 90
days to Field C" ? if the latter, suggest you try

IIf([Forms]![TheForm]![Field B] Is Not Null, DateAdd("d",90,[Field
B]), DateAdd("d",90,[Field C]))

hth



I am trying to use a macro to set the value of a date field(field A) to
be 90 days later than either field B or field C. I tried a conditional
setvalue expression like so:
If([Forms]![TheForm]![Field B]="Is Not Null",DateAdd("d",90,[Field
B]),DateAdd("d",90,[Field C]))
the item in the macro is field A.
I continue to get an error that say "The expression you entered has a
function name that Microsoft Access can't find"
Any ideas on why this is happening are greatly appreciated.
 
Back
Top