Do not use on any
shared computer
September 5, 2008 09:00pm pdt
 
[x]
Attachment Details

Need to disable/enable a control on another form based on the caption of the first form

Tags: VBA
I have a main form that allows users to engage in  a time study process.  Once the time study is over, I want the Adminstration to be able to disable the two time study commands on the Main Menu.  The disable process is a command on an Administration form.  HOwever, the process keeps stopping at the FORMS!frmMainMenu.cmdTimeTracking.Enabled = False  (or True depending on what the caption is).
with Run-Time error 438 Object doesn't support this property or method.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Private Sub cmdTimeStudyControls_Click()
'Controls Time Study access, that is, if another time study is wanted
'can enable the buttons for the forms/reports
    If Me.cmdTimeStudyControls.Caption = "Enable Time Study" Then
        Me.cmdTimeStudyControls.Caption = "Disable Time Study"
        DoCmd.OpenForm "frmMainMenu", acNormal
        Forms!frmMainMenu.cmdTimeTracking.Enable = True
        Forms!frmMainMenu.cmdTimeTrackingReport.Enable = True
        DoCmd.Close acForm, "frmMainMenu"
    ElseIf Me.cmdTimeStudyControls.Caption = "Disable Time Study" Then
        Me.cmdTimeStudyControls.Caption = "Enable Time Study"
        DoCmd.OpenForm "frmMainMenu", acNormal
        Forms!frmMainMenu.cmdTimeTracking.Enable = False
        Forms!frmMainMenu.cmdTimeTrackingReport.Enable = False
        DoCmd.Close acForm, "frmMainMenu"
    End If
End Sub
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Microsoft
Question Asked By: ssmith94015
Solution Provided By: svelarsen
Participating Experts: 2
Solution Grade: A
Views: 6
Translate:
Loading Advertisement...
 
[+][-]Accepted Solution by svelarsen
Accepted Solution by svelarsen:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jppinto
Expert Comment by jppinto:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by ssmith94015
Author Comment by ssmith94015:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628