Results 1 to 8 of 8
  1. #1
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97

    Locking a tab in a tabbed form

    It seems to me that the .Locked (or .readOnly) data property can be set only for single controls, but not for whole tabs in tabbed forms. On the contrary the .Enabled property works for whole tabs.
    Any turnaround to this limitation ??
    Thx

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You just don't like the dimming of the controls on the page of the TabControl?

  3. #3
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    the point is not just aesthetic, but rather
    1) dimmed (disabled) controls are too clear to be printed and read satisfactorily
    2) I need users to be able to get focus and copy content of locked controls, which can't be done if the controls are disabled
    Any hint to lock a tab ?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    In that case you are probably stuck with a For Each Control...Loop

  5. #5
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    good point.
    Could you please drive me through the VBA syntax for the "For Each Control in tab" statement ?
    Thanks

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Something like:
    Code:
       Dim ctl As Control
       For Each ctl In Me.Controls
          If ctl.ControlType <> acLabel Then
             ctl.Locked = True
          End If
       Next ctl

  7. #7
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    ok, but can I use this ??
    For Each ctl In MyTabName.Controls

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The TabControl is not a real control which is why *every* control on all of the pages needs to have an unique name. I would probably put something useful in the tag property of the controls I wanted locked and check for that value in the loop.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Information in tabbed form
    By dunnmel4 in forum Forms
    Replies: 7
    Last Post: 03-27-2011, 04:32 PM
  2. Tabbed form
    By leftylee in forum Forms
    Replies: 6
    Last Post: 03-14-2011, 12:45 AM
  3. can a tabbed form be too big? Help!
    By ma t in forum Forms
    Replies: 3
    Last Post: 03-10-2011, 10:03 AM
  4. Tabbed Form & Printing...
    By nchesebro in forum Forms
    Replies: 3
    Last Post: 12-20-2010, 03:03 PM
  5. Tabbed Sub Form
    By Vikki in forum Access
    Replies: 1
    Last Post: 02-10-2010, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums