'判断一个字段是否在表中
Function BlnField(sTblName As String, sFldName As String) As Boolean
'sTblName 源表名
'要查找的字段名
Dim fld As Field
Dim rs As DAO.Recordset
BlnField = False
Set rs = CurrentDb.OpenRecordset(sTblName)
rs.Fields.Refresh
For Each fld In rs.Fields
If fld.Name = sFldName Then
BlnField = True
Exit For
End If
Next
rs.Close
Set rs = Nothing
Set fld = Nothing
End Function
Private Sub 命令0_Click()
'返回True则有此字段,False则无
MsgBox BlnField("t...[ 查看全文 ]
如果您有什么好的建议或者疑问,可以联系我们。 商务合作QQ:3272218541;3282258740。商务合作微信:13319608704;13319603564。
加好友请备注机构名称。让我们一起学习、一起进步tulaoshi.com 版权所有 © 2019 All Rights Reserved. 湘ICP备19009391号-3
微信公众号