Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there an Auto_Close() procedure in Access??

Status
Not open for further replies.

LSTAN

Technical User
Feb 2, 2002
190
SG
Hi,

Just wondering is there an Auto_Close() procedure in Access97. If I want to run the below function everytime the users close/exit Access, where should I place it??

Code:
Function CutLinkTable()
Dim myDb As Database
Set myDb = CurrentDb
On Error GoTo Err_Check1
myDb.TableDefs.Delete "mainTable"
'
'
'
Exit Function
Err_Check1:
If Err.Number = 3265 Then
MsgBox Err.Description & ". " & "Please ensure that you have linked the required table/s." _
, vbOKOnly, "Error Message"
Exit Function
Else
MsgBox "Error Nos: " & Err.Number & ". " & Err.Description & ". " _
& "Please contact your system administrator.", vbOKOnly, "Error Message"
Exit Function
End If
End Function

Thanks and regards
LSTAN
 
Hi, Pezamystik

Actually what I want is to run a piece of code everytime the user click on the Close button of Access. Any idea how that can be done??

regards
LSTAN
 
If the form is open when Access is closed the onclose event for that form will be triggered.
 
Thanks, Pezamystik

Will try it out:)

LSTAN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top