设备预订 [英] Equipment Booking

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

问题描述




我正在做一个访问数据库来预订视听设备。我已经使用索引将date,equipmet和startTime作为主键,因为我不会两次预订相同的设备。但是我对ReturnTime感到很失落,因为如果设备从早上8点到早上11点出来,它可以让我从早上9点到早上10点预订。我的时间是从表格中选择的组合框中选出的。我的表格如下。


tblUserInfo

ID_PR(主键)

用户名

UserID


tblLoanInfo

ID_SC(主键)

ID_PR

LoanDate

设备

StartTime

EndTime


tblEquipment

设备

tblStartTime

StartTime


tblReturnTime

返回时间



我有一个包含用户信息的frmLoan和带有贷款日期,设备,启动时间和结束时间的loanInfo子表单。我不知道如何防止双重预订时间差。

Hi

I am curently doing an access data base to book audiovisual equipments. I have used index to have date, equipmet and startTime as primary key that way I dont book the same equipment twice. But am lost with the ReturnTime because if the equipment is out from 8am to 11am it lets me book from 9am to 10am for example. My times are selected from combobox which are fed by tables. My tables are the following.

tblUserInfo
ID_PR(primary key)
UserName
UserID

tblLoanInfo
ID_SC(primary key)
ID_PR
LoanDate
Equipment
StartTime
EndTime

tblEquipment
Equipment

tblStartTime
StartTime

tblReturnTime
ReturnTime


I have a frmLoan with the user information and the loanInfo subform with the loan date, equipment, starttime and endtime. I am stuck trying to figure out how to prevent double booking for time gaps.

推荐答案

正如您所知,索引中的开始时间不起作用。

插入新约会时,您需要测试或使用此设备ID与现有预订重叠。


另类可能要翻译翻译一天的时间变成24个红色/绿色文本框。因此,可用性也是可视化的,当您真正希望它具有灵活性时,即使可以使用OnClick进行时间选择。在这些盒子上...


Nic; o)
As you found out, the starttime in the index won''t work.
When inserting a new appointment you''ll need to test or for this equipment ID there''s an overlap with an existing booking.

An alternative might be to "translate" the times of a day into 24 red/green colored text boxes. Thus the availability is also visualized and when you really want it flexible, even the time selection could be done with the "OnClick" on these boxes...

Nic;o)


感谢您的信息nico。我试图找到一种方法,在我选择日期和设备,并选择开始时间后,代码可以验证所选的开始时间是否>>而不是返回。我有一个查询从表单中提取日期和设备,只是丢失了如何进行比较。
Thanks for the info nico. I am trying to find a way that after I select the date and equipment, and selecting the starttime a code can verify if the selected starttime is >= than the returntime. I have a query that pulls out the date and equipment from the form, just lost on how to do the comparison.


我已经做了一个qry来查找重叠时间并看到双重预订。我需要一些关于如何使用qry来防止此类事件的帮助。 qry看起来像这样。
I have done a qry to find overlap time and see double booking. I need some help on how to use the qry to prevent such events. The qry looks like this.
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


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

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