Conditional Formatting in Multiple Record subform (1 Viewer)

Lkwdmntr

Registered User.
Local time
Today, 03:51
Joined
Jul 10, 2019
Messages
277
Hello,
I have a subform that has two sets of Yes No checkboxes. The second set of checkboxes doesn't need to be used unless there is a tab reference in the record.

My wish is to have the boxes set that you can only check yes or no, not both.

The other wish is to have the checkboxes disappear if there is no tab reference.

I was able to get it to work on one record and all the records after that reflected the change. Here is a Zipped copy of my database. Please don't worry about the design (I already know it is flawed).

The Sub_MonSTChallenges - Sub_SunSTChallenges are the forms I am using. They are part of the FRM_Mon_Challenges - FRM_Sun_Challenges forms.

Most of the Forms are Pop out and Model. I stopped the opening form from going full screen, but not the others. In order to get Temp Values set for testing. There are a few steps to take. "Enter", "Reporting Forms", Select User Holly Flowers(she has the most data for testing.), "Next" and then right-click and go into design view and you're ready to test anything.
 

Micron

AWF VIP
Local time
Today, 06:51
Joined
Oct 20, 2018
Messages
3,476
My wish is to have the boxes set that you can only check yes or no, not both.
Put them in an option frame (that is a specific control) and only one can be chosen. They need to be added properly (the frame will go black as you draw the check in place). Can also use option buttons. The value of the button is passed to the frame, so you validate/bind the frame, not the buttons.


Don't know what a tab reference is. A tab control? A tab control page? A navigation form tab?

Forgot the file?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:51
Joined
Oct 29, 2018
Messages
21,357
Hi. Since Conditional Formatting doesn't work with Checkboxes or Buttons, I tend to use Textboxes to simulate them and then use code to perform the action the original controls were supposed to do.
 

Micron

AWF VIP
Local time
Today, 06:51
Joined
Oct 20, 2018
Messages
3,476
How did this morph into conditional formatting of checkboxes? The requirement was to be checked or not visible. Anyway, time to wait for a response IMHO.
 

Lkwdmntr

Registered User.
Local time
Today, 03:51
Joined
Jul 10, 2019
Messages
277
Sorry, I did forget the file. I working on something else that is blowing my mind. I might make a post on it in another thread. Heres the file that I believe you zipped to make it small enough to upload. I still would like to know how you did that.
 

Attachments

  • FettlerHealthDB3.zip
    1.9 MB · Views: 79

Galaxiom

Super Moderator
Staff member
Local time
Today, 21:51
Joined
Jan 20, 2009
Messages
12,849
How did this morph into conditional formatting of checkboxes? The requirement was to be checked or not visible. .

Because it is not possible to make checkboxes conditionally visible on a continuous form. It is possible to use conditional formatting to disable them.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:51
Joined
Oct 29, 2018
Messages
21,357
How did this morph into conditional formatting of checkboxes? The requirement was to be checked or not visible. Anyway, time to wait for a response IMHO.
Hi Micron. Check out the image I posted on this previous thread and please imagine the buttons with the up and down arrows are checkboxes. Notice how in some rows the buttons are not visible? This is what you can do with Conditional Formatting. I was just saying you can apply this technique on checkboxes too, which Colin actually demonstrated just a few posts after mine in that other thread. Hope that makes sense...
 

Micron

AWF VIP
Local time
Today, 06:51
Joined
Oct 20, 2018
Messages
3,476
Because it is not possible to make checkboxes conditionally visible on a continuous form. It is possible to use conditional formatting to disable them.
I guess that "continuous form" info is in the post title, because it sure ain't in the post itself. I'll bow out...
 

Lkwdmntr

Registered User.
Local time
Today, 03:51
Joined
Jul 10, 2019
Messages
277
I'd be very happy just disabling no box If the yes box was checked or vice versa.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:51
Joined
Feb 19, 2002
Messages
42,970
When you have mutually exclusive values, you need to use a SINGLE field rather than two fields. That is the underlying problem. Then you can use either a single checkbox where checked = yes and unchecked = no (be sure to set no as the default). OR, if you prefer to see both options, you would use an option group that included two buttons. The option group is bound to ONE field but can show multiple buttons, only one of which may be selected.

If you are not willing to modify your table to go to a single field rather than two, the only way to resolve the issue is by using code in the Form's BeforeUpdate event to ensure that one and only one of the two checkboxes is actually checked.
 

Lkwdmntr

Registered User.
Local time
Today, 03:51
Joined
Jul 10, 2019
Messages
277
You see I am using a Yes checkbox and a No checkbox because The client gets accountability points even if they didn't complete there challenge. So, I need both boxes.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 21:51
Joined
Jan 20, 2009
Messages
12,849
You see I am using a Yes checkbox and a No checkbox because The client gets accountability points even if they didn't complete there challenge. So, I need both boxes.

Use an Option Group.
 

Micron

AWF VIP
Local time
Today, 06:51
Joined
Oct 20, 2018
Messages
3,476
I still would like to know how you did that.
You left images in a table. I forget which one. You should link to images, not store them in Access tables. RE: the suggestion to use option group- see post 2. It makes the most sense., even if you had more choices. That is, of course, as long as this isn't on a continuous or datasheet form, which I still see no definitive answer about.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:51
Joined
Feb 19, 2002
Messages
42,970
So, I need both boxes.
No, you don't. Use ONE field. Use an option group. Set the default of the ONE field to Null. In the form's BeforeUpdate event, you can check the field to find out if it is null. If it isn't null, the user checked one of the two options in the option group. In your queries/code that assign points, use the value of the ONE field where 1 = yes and 2 = no (or whatever).

As I said earlier, if you insist on using two fields which all the experts agree is incorrect because the values are mutually exclusive, you need code in the FORM's BeforeUpdate event to ensure that one and only one of the two controls has a value. You are confusing interface with data. Interface is using an option group to display each of the potential values separately rather than having separate controls bound to separate fields which you now require code to control.
 

Users who are viewing this thread

Top Bottom