Avatar of Peter Chan
Peter Chan
Flag for Hong Kong

asked on 

Issue to DLookup in VBA

How to resolve issue with DLookup to line below? I want to validate if table "Week8-13" is existing within Access database. If that is not existing, then further copy details of T1 table into table "Week8-13".

Public Function TblExists(ByVal strTableName As String) As Boolean
TblExists = False
If Not IsNull(DLookup("Name", "MSysObjects", "Name = " & Chr(34) & strTableName & Chr(34) & " AND Type = 1")) Then TblExists = True
End Function

Open in new window

Microsoft AccessVBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
John Tsioumpris

8/22/2022 - Mon