DateTimePicker和DataBinding,2005EE,VB [英] DateTimePicker and DataBinding, 2005EE, VB

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

问题描述

大家好,

我有一个带有日期字段的数据库。自动"详细信息"将其插入到DateTimePicker_Ctrl等绑定到该字段的表单中。属性值设置为VS2005EE的今天日期。

I have a database with a date field. Automatically 'Details' insert it to a form like a DateTimePicker_Ctrl, bound to the field. The property Value is set to the today's date from VS2005EE.

但不幸的是,如果我使用Navigator_Save_Button保存新记录,则DateTimePicker提供Null,因此出现错误(Null不允许,我需要日期)。只有当我选择一个日期 - 而不是今天显示的日期时 - 日期才会正确转移到数据库。

But unfortunely if I save a new record with the Navigator_Save_Button the DateTimePicker deliveres Null, so an error appears (Null not allowed, I need the date). Only if I select a date - not the shown today's date - the date will correct transferred to the database.

用户不应该每个都选择一个日期他输入新记录的时间是99%,它是今天的日期。

The user should not need to pick up a date every time he enters a new record, cause in 99% it is the today date.

我该怎么办?表格的所有其他字段都将正确保存,不会有任何内容。

What have I to do? All other fields of the table will be saved correctly without any does.

感谢初学者

Thomas

推荐答案

您使用什么方法来创建新记录?当表单导航到新记录时,您需要自动将控件设置为今天的日期。
What method are you using to create the new record? You need to automatically set the control to today's date when your form navigates to the new record.


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

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