J
John Ortt
I have used the following code to kick unauthorised users out of my
database. The only problem I have is that the form I have which tells
people that the database is about to close does not refresh. It simply puts
the form frame on the screen with a hollow middle. Is there a way to force
Access to refresh the screen.
Thanks in advance,
John
P.S. This is a followup to the "Adding a delay before Code continues" topic.
Code follows:
Function Logoffcode()
Static MsgSent As Integer
Dim Logoff As Integer
Dim LO As Boolean
Set Db = CurrentDb() 'Note the table must be attached
'for CurrentDb() to work or use a
'connect string to the server db.
UserName = [Forms]![MainMenu].[UserBox]
If UserName = "BW643603" Then
[Forms]![MainMenu].OnTimer = ""
Else
docmd.Openform ("NonAuthorisedAccess")
[Forms]![MainMenu].OnTimer = ""
Call sSleep(5000)
Application.Quit
'Log them off
End If
End Function
database. The only problem I have is that the form I have which tells
people that the database is about to close does not refresh. It simply puts
the form frame on the screen with a hollow middle. Is there a way to force
Access to refresh the screen.
Thanks in advance,
John
P.S. This is a followup to the "Adding a delay before Code continues" topic.
Code follows:
Function Logoffcode()
Static MsgSent As Integer
Dim Logoff As Integer
Dim LO As Boolean
Set Db = CurrentDb() 'Note the table must be attached
'for CurrentDb() to work or use a
'connect string to the server db.
UserName = [Forms]![MainMenu].[UserBox]
If UserName = "BW643603" Then
[Forms]![MainMenu].OnTimer = ""
Else
docmd.Openform ("NonAuthorisedAccess")
[Forms]![MainMenu].OnTimer = ""
Call sSleep(5000)
Application.Quit
'Log them off
End If
End Function