Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Location
    Schererville, Indiana, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening Shared Database (1997)

    I am having a problem opening a database that I created. It is shared on the network. I haven't set up any security on it b/c I have given the users access only to those areas which are needed. Everything else has been hidden. I can open the database, but when I go to open the form to add new information, I get an error message.

    The message is: Couldn't lock table tblCompany; currently in use by user___ on Machine___.

    The specifics are filled in so that I know who is using it.

    Can anyone be of help?

    Thanks!!
    Tracy

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Opening Shared Database (1997)

    Several questions:
    <UL><LI>Are you the only person with the database open when this happens?
    <LI>What record locking option has been choosen under Tools/Options (I think that's where it's at in Access97)?
    <LI>Do you have any other forms open when you try to open the Add form?
    <LI>What kind of code, if any, is running when you try to open the Add form?[/list]The answers to those questions should give us some clues to work with.
    Wendell

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Location
    Schererville, Indiana, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening Shared Database (1997)

    To answer the questions:

    --NO, I am not the only one with the database open when I try to open the form.
    --Edited Record is set for the record locking option
    --There are no other forms open when I try to open the form
    --here is the code that is set.

    Private Sub Form_Current()
    Dim ctl As Control
    For Each ctl In Me.Controls
    If ctl.ControlType = acTextBox Then
    ctl.Locked = Not IsNull(ctl)
    End If
    Next
    Set ctl = Nothing
    End Sub

    It is a shared database, where I am the administrator. I can open the forms to edit them, and I can open the tables, but I am unable to open any of hte forms.
    Any help?

    Tracy

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Opening Shared Database (1997)

    It looks to me that your code for the Current event is causing your problem. Is there some reason you are trying to lock controls and unlock controls in the fashion this code would apparently do it? If you are trying to add a record, all controls must be unlocked or have default values set. If you want the form to only allow adding records, then set the form property Allow Additions to be True, and set the Allow Edits to be False - you may also want to set Allow Deletions to be False. Hope that helps.
    Wendell

  5. #5
    New Lounger
    Join Date
    Feb 2003
    Location
    Schererville, Indiana, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening Shared Database (1997)

    There is a reason for having the code as I do. There are blank fields in most of the database that need to be able to be edited when opening a company. I am locking hte fields that contain information so that the users cannot mess up what has already been put in, but they need to be able to edit what is left blank. This is because not all information is available when they enter the first initial information from the company and they want to be able to go and edit what is left blank. THis was done at the request of the supervisors.

    I am new to creating databases, so I am trying to get everything to work right and not have any problems, but it also needs to be done the way the users want it to

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Opening Shared Database (1997)

    In that case, I would open the form in DataEntry mode for adding records, and prevent Adding New Records when it is opened for editing. I don't know how you are selecting records, but it would mean having two menu items to do it that way. I would also turn of the Lock Edited Record property, and set it to use optomistic locking instead - that only locks the page being written to for the time the record is being saved. With it set the way it is, if another user has a record open on the page you are trying to add a record to, you will get the locking message. Unfortunately, Jet 3.5 (Access 97) can only lock on a page basis - Jet 4.0 (Access 2000) can lock on a record or a page basis. Hope this helps.
    Wendell

Posting Permissions

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