Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Sep 2004
    Location
    Sydney, New South Wales, Australia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    locking a subform (Access 2000 SP3)

    I have 2 tables linked in a one to many relationship. I use a form with an embedded subform to enter data. This works OK.

    I can also use the same form and subform to view the data and edit the data.

    What I would like to have happen is that when the form is opened to view the data all the controls should be unavailable for editing.

    I used

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: locking a subform (Access 2000 SP3)

    That is strange - opening a form as read-only should also open the subform as read-only. Are you absolutely sure that you can modify records in the subform?

    The screenshot below shows the navigation buttons of a form and subform; the main form has been opened with acFormReadOnly. As you can see, the New Record button is disabled in both the main form and subform.

  3. #3
    Star Lounger
    Join Date
    Sep 2004
    Location
    Sydney, New South Wales, Australia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: locking a subform (Access 2000 SP3)

    Hans
    Thanks for the response.

    The subform navigation buttons on my form are also disabled and when the form is opened all controls are disabled. However, I have a combo box on the subform that appears to be causing a problem. When I click on the combo box and try to select another value nothing happens as one would expect, however when I click on the combo box a second time (after having tabed out of it) the combo box is active and I can select another value. The other controls on the subform are then also enabled. The controls on the main form remain disabled.

    The combo box has code for the OnGotFocus and OnExit events. Is this code disabled when the form is opened as read only?

    Regards

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: locking a subform (Access 2000 SP3)

    No, that code is not disabled.

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  5. #5
    Star Lounger
    Join Date
    Sep 2004
    Location
    Sydney, New South Wales, Australia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: locking a subform (Access 2000 SP3)

    Thanks again Hans

    I will take out the code and if that fixes the problem I will work out another approach.

    Regards

Posting Permissions

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