Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Continuous form conditional formating control one vs control two

Posted on 2008-11-15
15
Medium Priority
?
241 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:Frank Freese
  • 8
  • 7
15 Comments
 
LVL 75
ID: 22969488
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
 

Author Comment

by:Frank Freese
ID: 22969702
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
 
LVL 75
ID: 22969759
Expression Is Me.OnTimeScrap=True

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

You need this:

[OnTimeScrap]=True  

mx
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

Author Comment

by:Frank Freese
ID: 22972329
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
 
LVL 75
ID: 22972774
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
 

Author Comment

by:Frank Freese
ID: 22973096
Open the form Comments.
0
 

Author Comment

by:Frank Freese
ID: 22973106
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
 

Author Comment

by:Frank Freese
ID: 22973115
This time I got the description for cf.zip. Open the form comments.
CF.zip
0
 
LVL 75
ID: 22973188
ok ... I have the mdb ... will check out shortly.

mx
0
 
LVL 75
ID: 22973343
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
 
LVL 75
ID: 22973356
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
 

Author Comment

by:Frank Freese
ID: 22975345
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
 
LVL 75
ID: 22977331
"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
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 22977342
*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
 

Author Closing Comment

by:Frank Freese
ID: 31517188
thanks for staying with me.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

810 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