是否有可能产生“结束日期”。输入开始日期和期限长度后? [英] Is it possible to generate an "end date" after entering start date and term length?

查看:81
本文介绍了是否有可能产生“结束日期”。输入开始日期和期限长度后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我希望找到一个问题的答案,我在Access 2007中使用表格。


我有一个表格(来源:表格)有三个字段:


开始日期

期限(月数)

结束日期


目前,用户必须输入开始日期,从下拉组合框中选择一个术语,然后输入结束日期。是否可以设置在组合框中选择术语后自动生成结束日期?


任何帮助将不胜感激!谢谢!

Hello all,

I''m hoping to find an answer to a question I have using forms in Access 2007.

I have a form (source: table) that has three fields:

Start Date
Term (number of months)
End Date

Currently the user has to enter a start date, select a term from a drop down combo box, and then enter an end date. Is it possible to have it set up where after the term is selected in the combo box the end date is automatically generated?

Any help would be greatly appreciated! thanks!

推荐答案

这是完全可能的,但存储可从现有数据计算的值的想法并不好(参见数据库规范化和表格结构了解更多信息。


实现此目的的代码是:
This is perfectly possible, but the idea of storing values that are calculable from existing data is not good (See Database Normalisation and Table structures for more).

The code to achieve this is :
展开 | 选择 | Wrap | 行号


是否有某种方式我应该为开始日期格式化输入或对于组合中的术语b牛?目前的格式是:


开始日期


数据类型:日期/时间

输入掩码:00/00 /" 20" 00 ;; _


期限


数据类型:文字

查询框,其中包含手动输入的条款,未链接到另一个表格(例如1个月,3个月,12个月等等......)

当我将你的代码粘贴到它返回的结束日期字段的控制源中时,
#ERROR在现场,但我假设上面提到的两个领域有问题。


再次感谢!
Is there a certain way I should format the input for the start date or for the term in the combo box? The current format is:

Start Date

Data Type: Date/Time
Input Mask: 00/00/"20"00;;_

Term

Data Type: Text
lookup box with the terms manually entered, not linked to another table (e.g. "1 month", "3 months", "12 months" and so on...)

when i pasted your code into the control source for the end date field it returned "#ERROR" in the field, but I''m assuming there is something wrong with the two fields mentioned above.

thanks again!


蒂姆,如果你需要一个数值 - 存储一个数值。如果你确切地知道它们的格式是如何确定的话,你可以从字符串中提取一个数值,但我不能用你的三个例子值来分享足够的信息。


PS。作为日期的日期很好,完全符合预期。
Tim, if you need a numeric value there - store a numeric value. You can probably extract a numeric value from the strings if you know exactly how they''re formatted, but I can''t as you haven''t shared enough information with your three example values.

PS. The date as a date is fine and exactly as expected.


这篇关于是否有可能产生“结束日期”。输入开始日期和期限长度后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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