View Full Version : check whether a table exists before running a macro


chthomas
02-22-2000, 01:15 AM
Hi,

Could any one tell me how to check whether a table exists before running a macro? ie if the table exists don't run the macro else run the macro.

Regards,

Charley

Travis
02-25-2000, 11:19 PM
Use this code

on error resume next
dim lCount as Long
dim stTable as String
stTable = "tblOLE"
lcount = currentdb.TableDefs(stTable).RecordCount
if err.Number = 3265 then
Msgbox "Table does not exist"
else
Msgbox "Table exists"
end if