非绑定窗体快速输入法
时间:2009-05-20 08:55 来源:accessbbs 作者:小雨 阅读:次
非绑定窗体快速输入法
'* * * * * * * * * * * * * * * * * * * * * * * * * * *
'* *
'* - - 非绑定窗体录入方法 - - *
'* 本模块要求表中的字段名与窗体中的字段名完全相同 *
'* 调用方法: *
'* Call ListTableFields("表名", me) *
'* 代码编写:csqhlx(小雨) *
'* 参考黄海的取出表中字段名的代码 *
'* *
'* * * * * * * * * * * * * * * * * * * * * * * * * * *
'Code Start
Option Compare Database
Public Function ListTableFields(TblName As String, frm As Form)
On Error Resume Next
Dim rstSchema As ADODB.Recordset
Dim rst As DAO.Recordset
Dim cnn2 As ADODB.Connection
Dim strSQL As String
strSQL = "SELECT * FROM " & TblName & ";"
Set cnn2 = CurrentProject.Connection
Set rst = CurrentDb.OpenRecordset(strSQL)
Set rstSchema = cnn2.OpenSchema(adSchemaColumns, Array(Empty, Empty, TblName))
rst.AddNew
While Not rstSchema.EOF
rst(rstSchema!COLUMN_NAME) = frm(rstSchema!COLUMN_NAME)
rstSchema.MoveNext
Wend
rst.Update
rstSchema.Close
cnn2.Close
rst.Close
Set rstSchema = Nothing
Set cnn2 = Nothing
Set rst = Nothing
End Function
'Code End
'* *
'* - - 非绑定窗体录入方法 - - *
'* 本模块要求表中的字段名与窗体中的字段名完全相同 *
'* 调用方法: *
'* Call ListTableFields("表名", me) *
'* 代码编写:csqhlx(小雨) *
'* 参考黄海的取出表中字段名的代码 *
'* *
'* * * * * * * * * * * * * * * * * * * * * * * * * * *
'Code Start
Option Compare Database
Public Function ListTableFields(TblName As String, frm As Form)
On Error Resume Next
Dim rstSchema As ADODB.Recordset
Dim rst As DAO.Recordset
Dim cnn2 As ADODB.Connection
Dim strSQL As String
strSQL = "SELECT * FROM " & TblName & ";"
Set cnn2 = CurrentProject.Connection
Set rst = CurrentDb.OpenRecordset(strSQL)
Set rstSchema = cnn2.OpenSchema(adSchemaColumns, Array(Empty, Empty, TblName))
rst.AddNew
While Not rstSchema.EOF
rst(rstSchema!COLUMN_NAME) = frm(rstSchema!COLUMN_NAME)
rstSchema.MoveNext
Wend
rst.Update
rstSchema.Close
cnn2.Close
rst.Close
Set rstSchema = Nothing
Set cnn2 = Nothing
Set rst = Nothing
End Function
'Code End
(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
相关内容
- ·关于 Partition 函数在分组查询中的应
- ·Access算术运算符的含义和说明表
- ·mid函数的另类用法
- ·access制作程序运行进度框
- ·Function与Sub的异同(函数调用)
- ·Access判断某个数值是否为某个数据类型
- ·select case后面语句块的值的四种格式
- ·vba条件语句的两种表示方法
- ·Access几种数据类型初始化的值
- ·Access vba null与""空字符串的区别
- ·access vba 数据类型表
- ·Access变量的命名规则
- ·Access中EXIT Sub与End Sub的区别
- ·Access vba中参数前关键字ByRef和ByVal
- ·Access列表框快速全选的技巧【最快】
- ·vba函数的数据类型强制转换
最新内容
推荐内容