DateAdd和IIf [英] DateAdd and IIf

查看:81
本文介绍了DateAdd和IIf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Access 2003中的表单上将DateAdd和IIf的表达式放在一起时遇到一些问题。


不确定我是否正确这样做但我使用的是具有SetValue的宏运行在退出字段[监控频率]以计算字段的新日期[评估审核日期],具体取决于[监控频率]的选择,例如1个月,3个月。

在宏的SetValue下我将项目设置为[评估审核日期],但不确定如何编写语句,以便如果从[监控频率]中选择1个月,则DateAdd将从[日期]添加1个月]字段在{评估审核日期]中输入新日期+1个月或如果选择3个月,则输入新日期+ 3个月

Having a few problems putting together an expression with DateAdd and IIf together on a form i have in Access 2003.

Not sure if i am doing this right but I am using a macro with SetValue to run On Exit from field [Frequency of Monitoring] to calculate a new date for the field [Assessment Review Date], depending on the choice made from [Frequency of Monitoring] e.g. "1 Month", "3 Month".
Under SetValue in macro i have set Item as [Assessment Review Date] but not sure how to write statement so that if 1 Month selected from [Frequency of Monitoring] then DateAdd will add 1 month from [Date] field to enter new date +1 month in {Assessment Review Date] or if 3 Months selected, enter new date +3months

推荐答案

尝试:
展开 | 选择 | Wrap | 行号


谢谢。 ;)这是一种享受,但我想允许选择大于1个月和3个月的审查日期,并返回适当的值,例如+1个月,+ 3个月,+ 6个月和+1年。

任何想法?
Thanks. ;) This works a treat but i want to allow a choice of review dates greater than just 1month and 3 month and it to return the appropriate value e.g. +1 month, +3 month, +6 month and +1 year.
Any ideas?



谢谢。 ;)这是一种享受,但我想允许选择大于1个月和3个月的审查日期,并返回适当的值,例如+1个月,+ 3个月,+ 6个月和+1岁。

有什么想法吗?
Thanks. ;) This works a treat but i want to allow a choice of review dates greater than just 1month and 3 month and it to return the appropriate value e.g. +1 month, +3 month, +6 month and +1 year.
Any ideas?



嵌套的iif语句或VBA代码。

Nested iif statements or VBA code.


这篇关于DateAdd和IIf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆