检查现有日期 [英] Check for existing date

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

问题描述

大家好,


我为员工创建了一个数据库来签名和签出。功能一直很好,但我遇到了一个人忘记如果登录或不登录的问题;因此他们会两次登录或退出。


格式化方式是每个员工姓名都显示在表单上,​​并在其名称下面有一个登录和注销按钮。当他们点击登录时,它会使用当前日期填写名为date1的字段,它还会填充一个名为signindate的字段,其中包含当前日期,它还会填写字段signintime中的当前时间。当他们点击退出时,它会填写一个名为signouttime的字段。


有人可以帮助我使用代码来禁用登录按钮,直到第二天或弹出一个msgbox如果当前日期已在数据库中显示其名称;例如,他们已经登录了。我已经尝试了一些事情,但仍然在努力,感谢您的帮助!

Hi everyone,

I have created a database for employees to sign it and out. The functionality has been working great but I am running into an issue of people forgetting if the signed in or not; therefore they will sign in or out twice.

The way it is formatted is every employees name is show on a form with a sign in and sign out button under their name. When they click sign in, it it fills in a field called date1 with the current date, it also fills in a field called signindate with the current date, it also fills in the current time in a field signintime. When they click sign out, it fills in a field called signouttime.

Could someone help me with the code to disable the button for signing in until the following day or popup a msgbox if the current date is already in the database for their name; for example they already signed in. I''ve tried a few things but am still struggling, thanks for the help!

推荐答案

1。您的数据库如何知道谁正在登录?员工是否从下拉框(或其他方式)中选择了他们的名字?


2.是否有员工在午夜工作?也就是说,你有一些可能在晚上签到并在早上退出的班次吗?这将决定如何计算是否允许他们重新登录。


谢谢!
1. How does your database know "who" is signing in? Does the employee select their name froma dropdown box (or some other means)?

2. Do any employees ever work through midnight? That is, do you have some shifts that might sign in during the evening and sign out during the morning? This would determine how to calculate whether to allow them to re-sign in.

Thanks!


嘿孪生!因此,表单中的所有员工姓名都在每个名称下都有一个登录和注销按钮。登录后面的代码是:

hey twinny! so the form has all the employees names with a sign in and sign out button under each name. the code behind sign in is :

展开 | 选择 | Wrap | 行号


欢迎回来,didacticone!

这会产生更多问题....


1.签出的程序是否相同?


2 。登录和签名是否保存在同一张桌子上?

评论


登录表单中有大量冗余数据。如果您有员工的姓名并使用Now()进行登录,则您有日期和时间(MS Access将日期/时间存储为日期 时间)。不需要登录是/否字段,因为登录日期/时间中的值表示唱歌。


不是最有效的方法,但是现在我们将保持原样。
Welcome back, didacticone!

This generates a couple more questions....

1. Is the sign out the same procedure?

2. Are sign-ins and sign-outs saved to the same table?

Comments:

There is a lot of redundant data on your sign-in form. If you have the employee''s name and use Now() for their sign-in, you have the date and the time (MS Access stores Dates/Times as a Date and a Time). No need for a sign-in Yes/No field, as a value in the sign-in date/time indicates a sing-in.

Not the most efficient way to accomplish this, but we will leave it as is, for now.


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

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