☘️

Accessでテーブルの存在を確認する関数

2024/01/04に公開
Public Function IsTableExist(strTableName As String) As Boolean
  Dim bolReturn As Boolean
  Dim obj As Object

  bolReturn = False
  For Each obj In Application.CurrentData.AllTables
    If (obj.Name = strTableName) Then
      bolReturn = True
      Exit For
    End If
  Next
  IsTableExist = bolReturn
End Function

Discussion