If somebody tries to close the program or the database, I am looking at setting up a password system.
I know that if the password is unsucsessfull then:
docmd.resume
What i have so far:
Dim pass As String
Dim db As Database
Set db = CurrentDb()
Dim docname As String
If Forms.Unload.pass = "acc" Then
DoCmd.Quit
Exit Sub
Else
If Forms.Unload.pass = "a" Then
DoCmd.Close acForm, "unload", acSaveNo
'DoCmd.Restore
'DoCmd.Close acForm, "mainscreen", acSaveNo
Else
DoCmd.Close
docname = "mainscreen"
DoCmd.OpenForm acForm, docname
DoCmd.Restore
End If
End If
i've been playing about with it.
But i need it to work when someone has presses the program close button.
I have the above code to trigger on the mainscreen "unload" event.
I know that if the password is unsucsessfull then:
docmd.resume
What i have so far:
Dim pass As String
Dim db As Database
Set db = CurrentDb()
Dim docname As String
If Forms.Unload.pass = "acc" Then
DoCmd.Quit
Exit Sub
Else
If Forms.Unload.pass = "a" Then
DoCmd.Close acForm, "unload", acSaveNo
'DoCmd.Restore
'DoCmd.Close acForm, "mainscreen", acSaveNo
Else
DoCmd.Close
docname = "mainscreen"
DoCmd.OpenForm acForm, docname
DoCmd.Restore
End If
End If
i've been playing about with it.
But i need it to work when someone has presses the program close button.
I have the above code to trigger on the mainscreen "unload" event.