Link to home
Create AccountLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Access VBA - check if table exists in another database


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

Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account