Check Box Problems :( (1 Viewer)

Spark021

Registered User.
Local time
Today, 16:29
Joined
Jan 4, 2015
Messages
15
Hi guys,

I have a form with 15 check boxes on all together. I want the "15th check box" to check to true automatically when the other 14 have been manually checked.
I have used a Tag for all of the other 14 check boxes they are tagged with the word "FILL". Here is my code:

Private Sub Check212_AfterUpdate()

Dim cntrl As Control

For Each ctrl In Me.Controls
If ctrl.Tag = "FILL" Then
If IsTrue(ctrl) Or Len(ctrl) = -1 Then
Check212 = True

End Sub

Check 212 is my 15th Check Box. I am pretty new to access so I apologize if I have made a newb mistake.

Thanks for any help in advance guys!
 
As check212 is your 15th check box it make as no sense to use its afterUpdate event.
You should create a sub unrelated to any of the combo and in every combo afterUpdate event call this sub.
This sub will check if all 14 check boxes are checked.

In Vba you must close any if with end if.

You can use:
If ctrl.Value = true
 
You could set the ControlSource of the 15th check box to . . .
Code:
=chk1 + chk2 +, ..., + chk14 = -14
. . . which evaluates to True when all the other CheckBoxes are checked.
 
Thank you for the replies.

I am very new to access so only know the basics for now I am taking lessons though so hopefully I should improve quickly.

I will try your suggestions now :)
 
It worked on my single form, But I have just realized this was already a bound checkbox. This is my new control source:

=[Check161]+[Check178]+[Check169]+[Check167]+[Check181]+[Check192]+[Check261]+[Check264]+[Check189]+[Check187]+[Check195]+[Check206]+[Check203]+[Check201]=-14

Can I make it so that this control source enters the true value into my "PlotComplete" field so that it will show as this job has been completed on my continuous form.

Cheers guys :)
 
Why dont you name your check boxes as checkBox1, 2, 3
Dont stay with the default names
 
Why dont you name your check boxes as checkBox1, 2, 3
Dont stay with the default names

I don't know really. I understand it is easier to find them later on down the line but I figure it doesn't take to long to just look back at them.

I need "Check212" to make the field "PlotComplete" true so that this will display on my continuous form. I have just read up that continuous forms don't like unbound check boxes :banghead:
 
Typically you do not store the results of calculations on your data. Store your data raw and do calculations at retrieval time. Write a query that does the math you want, then run that query against your raw data.

Data is like a rope. Pull on it and you can apply a lot of force, push on it, and, well, good luck with that. Storing a calculation is a push, not a pull.
 

Users who are viewing this thread

Back
Top Bottom