问题描述
Windows XP Pro,Access2003。
我有一个名为frmCheckSheet的表格和一个名为tblCheckSheet的表格。
表格上有是一个组合框cboSerialID,它是多列的,当选择序列号时,afterupdate事件会加载各种其他文本框,其中包含客户名称,部门,设备类型等。表单上的一个文本框是txtAssessment,它包含对检查项目...它链接到tblCheckSheet中的备注字段。
当用户创建新记录时,我希望将之前的评估加载到文本框中在表格上,他/她可以将这次设备的状况与之前检查的评估方式进行比较。此文本框将加载到cboSerialID的AfterUpdate事件上(以便它获取所需的工具)。
查询还需要在新记录(表格)上引用AutoDate(txtDate)文本框,以便它将之前的检查提取到今天的检查日期。 。
所以我想要这样的东西:
strSQL =" SELECT tblCheckSheet.Assessment from tblChecksheet WHERE tblCheckSheet.SerialID = cboSerialID.Column (0)" &安培; -
" AND tblCheckSheet.Date< txtDate"
有没有人知道确切的语法吗?我是否必须编写一份包含在声明中的函数?
希望以上内容是可以理解的,并再次感谢您的帮助。
Windows XP Pro , Access2003.
Hi I have a form called frmCheckSheet and a table called tblCheckSheet.
On the form there is a combobox cboSerialID which is multicolumn and when a serial number is selected the afterupdate event loads various other text boxes with customer name, department, type of equipment etc. One of the Text boxes on the form is txtAssessment, and it holds an assessment of the item checked...it is linked to a memo field in the tblCheckSheet.
When the user goes to create a new record I would like to have the previous assessment loaded into a textbox on the form so he/she can compare the condition of the equipment this time with how it was assessed the previous check. This Textbox would be loaded on the AfterUpdate event of the cboSerialID (so that it picks up the required instrument).
The query would also need to refer to the AutoDate (txtDate) Textbox on the new record (of the form)so that it picked up the previous check to whatever today''s check date happened to be.
So I would like something like:
strSQL = "SELECT tblCheckSheet.Assessment From tblChecksheet WHERE tblCheckSheet.SerialID = cboSerialID.Column(0)" & -
"AND tblCheckSheet.Date < txtDate"
Does anyone have any idea of the exact syntax please? Would I have to make up a function that is included in the statement?
Hope the above is understandable and again thanks for any assistance.
推荐答案
圣诞快乐Zaphod
我会看看周二/周三。
Mary
Merry Christmas Zaphod
I''ll have a look at this Tuesday/Wednesday.
Mary
这篇关于帮助查询或SQL选择语句..请的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!