countyworker
asked on
Table existence
Using VBA for Access, is there some way to test to see if a table exists?
If it does then continue processing, if not display a message "table not found, continuing processing on next table" and so forth.
It's probably very simple but I'm doing this with lame books, lame F1 keys and no real support at my workplace.
Thanks for any help.
If it does then continue processing, if not display a message "table not found, continuing processing on next table" and so forth.
It's probably very simple but I'm doing this with lame books, lame F1 keys and no real support at my workplace.
Thanks for any help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi countyworker,
This old question (QID 20566994) needs to be finalized -- accept an answer, split points, or get a refund. Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
This old question (QID 20566994) needs to be finalized -- accept an answer, split points, or get a refund. Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
-->Accept SSSoftware's comment as Answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER
GPrentice00
Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
-->Accept SSSoftware's comment as Answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER
GPrentice00
Cleanup Volunteer
This works:
Public Sub Tabletest()
' Prints out all table names
' Tables that begin with MSys are Access internam tables
Dim I As Integer
For I = 0 To Application.CurrentDb.Tabl
Debug.Print Application.CurrentDb.Tabl
Next I
' Tests for the table "TestResults"
On Error GoTo NotFound
If Application.CurrentDb.Tabl
MsgBox "Table Found"
End If
On Error GoTo 0 ' reset the error handler
Exit Sub
NotFound:
MsgBox "Table Not found"
End Sub
Good Luck,
Ed