Avatar of Murray Brown
Murray Brown
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Access VBA - check if table exists in another database

Hi

I am using the following Access VBA to delete a table in another database. I want to use similar code to check if a table exists in another database. How would I do this?

    Dim db As dao.Database
    Dim tbd As dao.TableDef
    Dim strDestination As String
    Dim strSQL As String
    
    strDestination = CurrentProject.Path & "\" & strD

Set db = DBEngine.OpenDatabase(strDestination)
        db.Execute "Drop Table [" & strT & "]"

Open in new window

Microsoft AccessVBA

Avatar of undefined
Last Comment
Jim Dettman (EE MVE)

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jim Dettman (EE MVE)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck