Solved

Disable editing on form based on selection of another field

Posted on 2013-01-25
6
373 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

734 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