C
Cire via AccessMonster.com
Hi all, i searched for code in this forum for checking of existence of table
before deleting, i found the code shown below but i don't know how to use
functions, do i place this code in a module then invoke it in the form i want?
if yes how do i invoke it? i would probably want to put this in my "exit"
command button for my main menu form. And i'm using Access 2003, and if there
are other alternatives please do share too.
Thanks
Eric
Public Function TableExists(strTableName as String) as Boolean
dim tdf as dao.tabledef
TableExists = False
for each tdf in currentdb.tabledefs
if tdf.name = strTableName then
TableExists = True
Exit For
end if
next
End Function
before deleting, i found the code shown below but i don't know how to use
functions, do i place this code in a module then invoke it in the form i want?
if yes how do i invoke it? i would probably want to put this in my "exit"
command button for my main menu form. And i'm using Access 2003, and if there
are other alternatives please do share too.
Thanks
Eric
Public Function TableExists(strTableName as String) as Boolean
dim tdf as dao.tabledef
TableExists = False
for each tdf in currentdb.tabledefs
if tdf.name = strTableName then
TableExists = True
Exit For
end if
next
End Function