Setvalue

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.
 
T

tina

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
 
M

Mark Hubbard

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.
 

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