98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access VBA Training and help » Check boxes
Check boxes
Resolved · High Priority · Version 2003
Chloe has attended:
Access VBA course
Check boxes
Hi I have a form which has multiple check boxes. I have a list of labels that are named chkjob1, chkjob2...chkjob6,
I would like to create a function that checks all the check boxes for a job when the label is selected/clicked. so once you click on a the label for the job e.g jobA and hit run the details of the job (jobA) will be passed into the fuction which would have an array that would build the names of check boxes and select the row.
eg
form
if label JobA is selected then
pass jobA into the function ()
Function()
chk & jobA & (i)
= chkJobA1. value = true <name of check box>
repeat for all six check boxes.
Please email me if you do not understand what I mean.
I want a seperate fuction so that it can be used for multiple jobs, without endless code.
Many Thanks
Chloe
RE: check boxes
Hi Chloe
Thanks for the question.
Because you have named your check boxes in a numeric sequence you can use a for loop to walk through them and populate your array.
Dim iCounter As Integer
Dim Jobs(4) As Boolean
For iCounter = 1 To 4
Jobs(iCounter) = Me.Controls("chkjob" & iCounter).Value
Next iCounter
I hope that helps.
Laura GB
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Hiding rows and columnsTo hide a column or row in Access, you need to minimise the column or row. This can be done by placing your mouse on the right edge of a column, wait for the mouse to change to a double aroow and then drag to minimise the column |