Help with Check Boxes and Sub Forms

SimontheSkater

New member
Local time
Yesterday, 23:16
Joined
Aug 15, 2024
Messages
5
So, I have an issue. I have a form with a sub form but for each line I need a checkbox. When a checkbox is placed, it is duplicated and functional as one checkbox. If I click one checkbox, they are all checked. I need some way to get them to separate. Is there any way with VBA for when the duplications occur that the name of each check box created gets changed? I'm assuming this is the reason that they all function as one, because they all are just one checkbox (Duplicated). For the most part they are NEEDED for a visual, no true functionality.
 
Why are you crossposting in other forums? :(
 
I am new to forums, I did not know this was taboo.
 
Hi. Welcome to AWF!

You must be using an unbound checkbox instead of a bound one.
 
what would you suggest, I don't really want to tie the checkbox to the data. It is for mere visual verification.
 
Is anyone able to help with this VBA Code?
Check here...
 
I think my post covers most possible ways to do it. The pros and cons are listed. So for more help you will need to provide more details on what you will do with the checks. If you do not need to persist the selections you have more options.
 
PersonnelSelector.Initialize Me.chkSelected, "Serial", "Serial" I get Run Time Error 424 Object required
 
Last edited:
what would you suggest, I don't really want to tie the checkbox to the data. It is for mere visual verification.
When the checkbox is not tied to the data, it will duplicate on a continuous or datasheet form. Why? continuous and ds forms are simply single forms that are repeated. Each form has only ONE set of variables. So, if you changed the label of a control, it would change for all controls. Since the checkbox is not bound to the data, it works like a label would. It is just another constant as far as Access is concerned.
MajP offered several options to solve the problem.

Another option, might be to use a multi-select listbox to check the items. This is far less flexible than a form and would only work for you in limited situations.
 
PersonnelSelector.Initialize Me.chkSelected, "Serial", "Serial" I get Run Time Error 424 Object required
Without seeing your code my guess is you did not instantiate at the top of the module the class
Code:
Option Explicit

Dim PersonnelSelector As New Record_Selector

Private Sub Form_Load()
  Me.ID.SetFocus
  PersonnelSelector.Initialize Me.chkSelected, "ID", "ID"
End Sub
 

Users who are viewing this thread

Back
Top Bottom