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

x
?
Solved

Disable editing on form based on selection of another field

Posted on 2013-01-25
6
Medium Priority
?
394 Views
Last Modified: 2013-01-25
I have a form that has several fields on it.  One of the controls is a Yes/No check box that the user selects if applicable.  The default is unchecked.

When the user checks the box, I want a couple of the other fields to grey out where the user cannot enter data into those fields.

The Yes/No check box is called RateCardCheck.  The fields I want to grey out if RateCardCheck is check are:

dtaEstValue
dtaEstLabor$
dtaProjHrs

I tried an After Update to make the 3 fields not visible but it only worked once.  When I unchecked the box, the fields did not re-appear.
0
Comment
Question by:actolex
  • 3
  • 2
6 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38819874
use the afterupdate or click event of the checkbox

me.dtaEstValue.enabled=not me.RateCardCheck

me.[dtaEstLabor$].enabled=not me.RateCardCheck

me.dtaProjHrs.enabled=not me.RateCardCheck
0
 
LVL 31

Expert Comment

by:hnasr
ID: 38820249
If version:

If RateCardCheck Then
    dtaEstValue.Enabled = False
    dtaEstLabor$.Enabled=False
    dtaProjHrs.Enabled=false
Else
    dtaEstValue.Enabled = True
    dtaEstLabor$.Enabled=True
    dtaProjHrs.Enabled=True
End IF
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38820255
too many lines of codes, when you can do it 3
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:actolex
ID: 38820668
Both don't work....I'll try again this weekend.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 38820685
what codes do you have?

post it here.


is it  like this

private sub RateCardCheck_afterUpdate()

me.dtaEstValue.enabled=not me.RateCardCheck

me.[dtaEstLabor$].enabled=not me.RateCardCheck

me.dtaProjHrs.enabled=not me.RateCardCheck 

end sub

Open in new window


or this

private sub RateCardCheck_click()

me.dtaEstValue.enabled=not me.RateCardCheck

me.[dtaEstLabor$].enabled=not me.RateCardCheck

me.dtaProjHrs.enabled=not me.RateCardCheck 

end sub

Open in new window


and

private sub form_current()

me.dtaEstValue.enabled=not me.RateCardCheck

me.[dtaEstLabor$].enabled=not me.RateCardCheck

me.dtaProjHrs.enabled=not me.RateCardCheck 

end sub

Open in new window

0
 

Author Comment

by:actolex
ID: 38820925
capricorn1....I used the first set of code...now works great !!!!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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 …

963 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