dFirst()函数
时 间:2020-03-21 07:49:54
作 者:souelove ID:7327 城市:郑州
摘 要:dFirst()
正 文:
' ***************************
' Typical Use
' Numerical values. Replace "number" with the number to use.
variable = DFirst("[FieldName]", "TableName", "[Criteria] = number")
' Strings.
' Numerical values. Replace "string" with the string to use.
variable = DFirst("[FieldName]", "TableName", "[Criteria]= 'string'")
' Dates. Replace "date" with the string to use.
variable = DFirst("[FieldName]", "TableName", "[Criteria]= #date#")
' ***************************
' ***************************
' Referring to a control on a form
' Numerical values
variable = DFirst("[FieldName]", "TableName", "[Criteria] = " & Forms!FormName!ControlName)
' Strings
variable = DFirst("[FieldName]", "TableName", "[Criteria] = '" & Forms!FormName!ControlName & "'")
' Dates
variable = DFirst("[FieldName]", "TableName", "[Criteria] = #" & Forms!FormName!ControlName & "#")
' ***************************
' ***************************
' Combinations
' Multiple types of criteria
variable = DFirst("[FieldName]", "TableName", "[Criteria1] = " & Forms![FormName]![Control1] _
& " AND [Criteria2] = '" & Forms![FormName]![Control2] & "'" _
& " AND [Criteria3] =#" & Forms![FormName]![Control3] & "#")
' Use two fields from a single record.
variable = DFirst("[LastName] & ', ' & [FirstName]", "tblPeople", "[PrimaryKey] = 7")
' Expressions
variable = DFirst("[Field1] + [Field2]", "tableName", "[PrimaryKey] = 7")
' Control Structures
variable = DFirst("IIf([LastName] Like 'Smith', 'True', 'False')", "tableName", "[PrimaryKey] = 7")
' ***************************
Access软件网QQ交流群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- Access制作的RGB转CM...(09.22)
- Access制作的RGB调色板...(09.15)
- Access制作的快速车牌输入...(09.13)
- 【Access高效办公】统计当...(06.30)
- 【Access高效办公】用复选...(06.24)
- 根据变化的日期来自动编号的示例...(06.20)
- 【Access高效办公】按日期...(06.12)
- 合并列数据到一个文本框的示例;...(05.06)
- 通过命令按钮让Access列表...(04.24)
学习心得
最新文章
- Access做的一个《中华经典论语...(10.25)
- Access快速开发平台--加载事...(10.20)
- 【Access有效性规则示例】两种...(10.10)
- EXCEL表格扫描枪数据录入智能处...(10.09)
- Access快速开发平台--多行文...(09.28)
- 关于从Excel导入长文本数据到A...(09.24)
- Access制作的RGB转CMYK...(09.22)
- 关于重装系统后Access开发的软...(09.17)
- Access制作的RGB调色板示例(09.15)
- Access制作的快速车牌输入改进...(09.13)


.gif)
