Solved

Disable editing on form based on selection of another field

Posted on 2013-01-25
6
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 30

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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

623 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