Solved

Select all fields on "tab"

Posted on 2004-09-08
1
254 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

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…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now