I have never done this. I would be cautious about doing so, because it
could
get messed up so that neither user could open the form. However, my
first
idea would be to create a table with one record and one field. Then use
the
Open event of the form to check to see if the form is open by someone else
before allowing the form to continue opening.
Dim rst As Recordset
Set rst = Currentdb.OpenRecordset("TableName")
If rst![InUse] = "Yes" Then
MsgBox "This Form Is not Available"
Cancel = True
Else
rst.Edit
rst![InUse] = "Yes"
End If
rst.Close
Set rst = Nothing
And in the Close event of the form:
Currentdb.Execute("UPDATE MyTable SET InUse = 'No';"), dbFailOnError
Paulo Ferreira said:
As the form is used for two persons to add records, I would like to limit
the access to that form to one at a time.
Thanks