Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    16

    Unanswered: multi-user problem

    I have a multi-user db that I'm working with. I have a form for entering users with a ListBox that displays their user names. Because of the 255 record limit on ListBoxes when using a Value List I put all of the user names in a table and populate the ListBox with a query. Presto! No 255 user name limit.

    However, this table is only temporary because it's user names and I don't want to maintain user names myself (I'd rather let Access do it and just copy the data). So, because this table is only supposed to be temporary I delete all data out of it everytime I call a function called FillListBox (code reuse, this is called from all over to refresh or re-populate the ListBox) and then in FillListBox I just repopulate the ListBox from Workspace.Users.

    That all works pretty well.

    Here's the problem:

    If a subsequent user logs in, the first user has all user names change into "#delete".

    What I'd like to do is not allow any other users to open the User Management form. I tried to do this by setting a Boolean to true when the form was open and not allowing it to opened by another user while this boolean was still true. But that didn't work, a user on another machine can still open the form. I also tried to create a new table with a Y or N for open or not open with this kind of code:

    Dim UserRecordSet As DAO.Recordset
    Dim TheField As Variant
    Dim TheDatabase As DAO.Database
    Dim TheQueryString As String

    Set TheDatabase = CurrentDb()
    TheQueryString = "SELECT * FROM UserGroupManagementState"

    Set UserRecordSet = TheDatabase.OpenRecordset(TheQueryString)
    If Not UserRecordSet.BOF Then
    UserRecordSet.MoveFirst
    End If
    UserRecordSet.Edit
    UserRecordSet!Open = "Y"
    UserRecordSet.Update

    But I get 'No Current Record' on the line UserRecordSet.Edit.

    Any one have any ideas on how to keep subsequent users out of this form? Or read/write to a table via code?

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: multi-user problem

    My heads is not completely plugged in at the moment so this solution is good for interim.

    On open of the form, check a file say(a.txt) exists, if not generate a text file in the same location that the db is and open the form. If the file exists, then the form may not be opened.

    On close of the form, delete this file.

    Rather than relying on access, create a text file or something onto the server ...

    If you need sample code let me know ...


    Originally posted by Tim Y.
    I have a multi-user db that I'm working with. I have a form for entering users with a ListBox that displays their user names. Because of the 255 record limit on ListBoxes when using a Value List I put all of the user names in a table and populate the ListBox with a query. Presto! No 255 user name limit.

    However, this table is only temporary because it's user names and I don't want to maintain user names myself (I'd rather let Access do it and just copy the data). So, because this table is only supposed to be temporary I delete all data out of it everytime I call a function called FillListBox (code reuse, this is called from all over to refresh or re-populate the ListBox) and then in FillListBox I just repopulate the ListBox from Workspace.Users.

    That all works pretty well.

    Here's the problem:

    If a subsequent user logs in, the first user has all user names change into "#delete".

    What I'd like to do is not allow any other users to open the User Management form. I tried to do this by setting a Boolean to true when the form was open and not allowing it to opened by another user while this boolean was still true. But that didn't work, a user on another machine can still open the form. I also tried to create a new table with a Y or N for open or not open with this kind of code:

    Dim UserRecordSet As DAO.Recordset
    Dim TheField As Variant
    Dim TheDatabase As DAO.Database
    Dim TheQueryString As String

    Set TheDatabase = CurrentDb()
    TheQueryString = "SELECT * FROM UserGroupManagementState"

    Set UserRecordSet = TheDatabase.OpenRecordset(TheQueryString)
    If Not UserRecordSet.BOF Then
    UserRecordSet.MoveFirst
    End If
    UserRecordSet.Edit
    UserRecordSet!Open = "Y"
    UserRecordSet.Update

    But I get 'No Current Record' on the line UserRecordSet.Edit.

    Any one have any ideas on how to keep subsequent users out of this form? Or read/write to a table via code?
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •