Using MS Access expression builder for if fieldA value = " then fieldBdate = " table name is myOrder; myOrder has several fields including fieldA text (using value list for value selection, of which "Received" is one); And another field is named fieldBdate of DateTime type.
either
iif (fieldA] = "Received",[ fieldBDate] = Date(), null);
or
if ([fieldA] = "Received" then[ fieldBdate] = Date()
failed to meet with Access expression syntax
with both Access 2000 and Access 2010. What's the correct syntax?
Thanks.
Time for you to learn how to use built-in VBA manual with Intellisense and even basic google search of IIf syntax
How to use:
In your case:
EDIT - Based upon your comment that you want to set Default Value
You cannot set the Default Value expression based on another field in a table design. Think about it - there's no way that Access knows what the other field's value is until it's actually entered.
What you need to do is add the above code to your
FieldA_AfterUpdateevent