Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Select all fields on "tab"

Posted on 2004-09-08
1
Medium Priority
?
303 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 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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.

971 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