Solved

Select all fields on "tab"

Posted on 2004-09-08
1
281 Views
Last Modified: 2006-11-17
OK...I am using the "on current" section of a Form of mine to do the following...

Private Sub Form_Current()

        If Me.cboProjectStatus = "COMP" Then
        Me.alternate_project_nbr.Enabled = False
        Me.alternate_project_nbr.Locked = True
       
        Me.cboCRM.Enabled = False
        Me.cboCRM.Locked = True
       
        Me.cboProjectSize.Enabled = False
        Me.cboProjectSize.Locked = True
       
        Me.cboPriority.Enabled = False
        Me.cboPriority.Locked = True
End If
End Sub

My question is this...do I have to go through every field and specify it or can I specify the entire "tab section" of my form and will is select all of them that way?

I can do Me.tabDemand.Enabled = False

but that "dims" everything out.  I want it still "white" but just can't click on it.


Cheers!
Dark Magneto
0
Comment
Question by:darkmagneto
1 Comment
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 250 total points
ID: 12010533
Unfortunately not - tab controls and pages don't have an equivalent of the Locked option. They're either enabled or not, so you will need to cycle through the controls. One thing you could do is put something into the Tag properties of the controls (say the letter L) you want to lock and do something like this:

Dim ctl As Control

If Me!cboProjectStatus="COMP" Then
   For Each ctl In Me.Controls
      If ctl.Tag="L" Then
         ctl.Locked=True
         ctl.Enabled=False
      End If
    Next
End If

This will save you from having to write and maintain a long string of If/Then statements.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question