Continuous form conditional formating control one vs control two

Experts,
My continuous form has a bound check box control OnTimeScrap where the default is False.
I also have a text box txtOnTimeScrap. This control is bound the OnTimeScrap.
I understand that I can not make a bound control invisible in a continuous form.  Therefore, I would like to enable/disable my control through conditional formatting. I've tried but I can not get it to work.
Here's my objective. If Me.OnTimeScrap = -1 then I want to disable this control.
Frank FreeseAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
ok

Apply CF to the txtOnTimeScrap text box as follows:

Condition1:         <expression>                  
Expression Is    [OnTimeScrap]=True       Click the last tool bar past Fore Color - which is the Enable/Disable

You could also change the Backcolor to indicated it was disabled if you wish.

mx
0
Frank FreeseAuthor Commented:
Here's what I did:
I selected the control txtOnTimeScrap
Condition 1:
Expression Is Me.OnTimeScrap=True
Selected Enabled/Disabled
The results was that the txtControl was disabled, however, the bound control OnTimeScrap continues to work.
What I do not want the user to do is to change from check to uncheck but they can change uncheck to checked, the bound control OnTimeCheck.
I remember you telling me that a check box can not have CF so we moved to another control to disable the check box.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Expression Is Me.OnTimeScrap=True

You can't use 'Me' in this expression, only in VBA code.

You need this:

[OnTimeScrap]=True  

mx
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Frank FreeseAuthor Commented:
I must be missing something here MX. I changed the expression as suggested but it still does not act on the bound check box control OnTimeScrap. It does work on the text control txtOnTimeScrap. I've tried this with  txtOnTimeScrap control source = OnTimeScrap as well as nothing in the txtOnTimeScrap control source.
Excuse my redundancy. My continuous form has two controls. OnTimeScrap is bound to control source OnTimeScrap and is a check box control visible is Yes and Enabled is Yes.
My second control is txtOnTimeScrap and is unbound. It is visible and Enabled is Yes.
My CF is on txtOnTimeScrap with only 1 condition
Expression Is [OnTimeScrap]=True  and Disabled.
Thanks for hanging in there with me.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
ok ...

Can you Compact & Repair (to shrink the size), then zip up the MDB, then attach the file for upload here (using the 'Attach File function below) ... removing any sensitive data of course? And please give a clear explanation of exactly how to reproduce the problem.

mx
0
Frank FreeseAuthor Commented:
Open the form Comments.
0
Frank FreeseAuthor Commented:
do you see the zip file? I went to attach file, add file. it went through uploading but i should have been ask to give it some title.
0
Frank FreeseAuthor Commented:
This time I got the description for cf.zip. Open the form comments.
CF.zip
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
ok ... I have the mdb ... will check out shortly.

mx
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
ok ... still a bit confused.

"The second control is OnTimeScrap. This control is what I've been wanting to disable. "
Based on what condition ?  You say:

"Again, the objective is that if OnTimeScrap is True then I do not want to disable the check box. Right now the users do all this manually and it takes a lot of time. "

You're saying the if the Check box is True - don't disable it ?  Otherwise disable it ?

Then what is the purpose of txtOnTimeScrap ? The CF in that control isn't really doing anything ...

Soo ??

mx
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Based on what you are saying, the only way I can see this happening is if you do this in the Form On Current event:

Private Sub Form_Current()
    If Me.chkOnTimeScrap = True Then
        Me.chkOnTimeScrap.Enabled = True
    Else
        Me.chkOnTimeScrap.Enabled = False
    End If
End Sub

Note that I renamed the check box - to be different than the Control Source - so the name is chkOnTimeScrap

mx
0
Frank FreeseAuthor Commented:
I thought of that also earlier and did try your code. I caused all of the chkOnTimeScrap to be disabled if false. It appears that the cf only applies to the control it is working on and not another control. You worked hard on this and deserve the credit. Whats the best way to close this with credit?
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
"I caused all of the chkOnTimeScrap to be disabled if false."

Well ... yes, depending on the check boxes state when you click into a row, they will all assume the same state based on the condition - not the ideal solution. Maybe there is another way.  Possibly I don't completely understand what is needed here ?

mx
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
*typically* ... a check box or a text box would be enabled/disabled based on the state of another control (that has a Control Source) or an expression based on another control(s), etc.

mx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Frank FreeseAuthor Commented:
thanks for staying with me.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.