R
Rob
I came across this code and am trying to use it for my database. Is a small
database that will track the process of moving code through the SDLC process.
Each time there is movement to testing an approval is warranted. There may
be up to 20 or so people using this database at the same time and if I run
into problems and need exclusive rights, I would like to be able to
"kickemoff". Here is the code that I am using.
Function fGetOut() As Integer
Dim RetVal As Integer
Dim db As DAO.Database
Dim rst As Recordset
On Error GoTo Err_fGGO
Set db = DBEngine.Workspaces(0).Databases(0)
Set rst = db.OpenRecordset("KickEmOff", dbOpenSnapshot)
If rst.EOF And rst.BOF Then
RetVal = True
GoTo Exit_fGGO
Else
If rst!GetOut = True Then
'This is where you close down any forms, and quit the database
'I leave this section as an exercise in creativity
Application.Quit
Else
RetVal = True
End If
End If
Exit_fGGO:
fGetOut = RetVal
Exit Function
Err_fGGO:
'Note lack of message box on error
Resume Next
End Function
This is in a module and there is a form that I am told that if I click the
box and hit enter, all users should be knocked out of the database. Is there
something that I need to add here. I am getting no error messages, yet the
users are still on when I use the form.
database that will track the process of moving code through the SDLC process.
Each time there is movement to testing an approval is warranted. There may
be up to 20 or so people using this database at the same time and if I run
into problems and need exclusive rights, I would like to be able to
"kickemoff". Here is the code that I am using.
Function fGetOut() As Integer
Dim RetVal As Integer
Dim db As DAO.Database
Dim rst As Recordset
On Error GoTo Err_fGGO
Set db = DBEngine.Workspaces(0).Databases(0)
Set rst = db.OpenRecordset("KickEmOff", dbOpenSnapshot)
If rst.EOF And rst.BOF Then
RetVal = True
GoTo Exit_fGGO
Else
If rst!GetOut = True Then
'This is where you close down any forms, and quit the database
'I leave this section as an exercise in creativity
Application.Quit
Else
RetVal = True
End If
End If
Exit_fGGO:
fGetOut = RetVal
Exit Function
Err_fGGO:
'Note lack of message box on error
Resume Next
End Function
This is in a module and there is a form that I am told that if I click the
box and hit enter, all users should be knocked out of the database. Is there
something that I need to add here. I am getting no error messages, yet the
users are still on when I use the form.