Solved Checkbox not working on checklist (1 Viewer)

AlliCarr

New member
Local time
Today, 08:15
Joined
Feb 19, 2024
Messages
11
Hi there,

I have recently added multiple checklists to my database after following the instructions on Nifty Access. Everything looks great and the correct lists are showing in each checklist sub form but for some reason, when testing, I am unable to tick the checkboxes. When I open the sub form outside of the parent form, I can tick the checkboxes but not when it is a sub form on the parent form.

I've checked the properties of both the sub form and the parent form and both allow edits, additions etc. so I'm not quite sure why the sub form is not working as expected. The parent form has a tab control which holds the forms controls along with the sub forms for the checklists so not sure if that makes a difference.

Any help would be appreciated.

Kind regards
Allison
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 03:15
Joined
May 21, 2018
Messages
8,527
Can you post your form's code? Can you post your sql for the query? Or simply post the db?
 

AlliCarr

New member
Local time
Today, 08:15
Joined
Feb 19, 2024
Messages
11
Hi,

I've attached a copy of the database. I've stripped out as much as I dare so as not to affect the functionality of the relevant forms. On the form that opens up first, clicking on any of the links will take you to the 'OrganisationF' form where the checklists are. There's one on the 'Status' tab and on the 'Services and beneficiaries' tab. The tables I'm pulling the information from are:
OrganisationDetailsT
OrgDataListT
OrgDataLookupT
OrgDataT

Please let me know if you need any more info.

Kind regards
Allison
 

Attachments

  • SupportDB.zip
    4.5 MB · Views: 42

tvanstiphout

Active member
Local time
Today, 00:15
Joined
Jan 22, 2016
Messages
220
You stripped out a bit too much: TaskListSubF is a subform of OrganisationF, and it is not included.
 

June7

AWF VIP
Local time
Yesterday, 23:15
Joined
Mar 9, 2014
Messages
5,468
CommsXSuppProvidedF also not included. However, these omissions can be ignored in analyzing issue. Just remove references in SourceObject property.

So far, I am at a loss as to why these "checklists" (just forms in Datasheet) won't allow edit when placed as a subform.

Side note: could improve code indenting to make more readable. Also, most consider it best practice to declare all variables at top of procedure.
 

AlliCarr

New member
Local time
Today, 08:15
Joined
Feb 19, 2024
Messages
11
Side note: could improve code indenting to make more readable. Also, most consider it best practice to declare all variables at top of procedure.
Thanks for the good advice 👍🏻 something I can work on 😊
 

June7

AWF VIP
Local time
Yesterday, 23:15
Joined
Mar 9, 2014
Messages
5,468
Issue seems to be involved with this code:

'Opens selected organisation and diables editing
DoCmd.OpenForm "OrganisationF", , , "OrganisationURN =" & Me.OrganisationURN, acFormReadOnly

If I remove acFormReadOnly, there are no records listed in subforms. More oddness is that when I set a breakpoint on this line, OrganisationName_Click() event does not show execution when I click on organization name. I disabled error handler and no difference.

You declare a variable:
Dim OrganisationURN As Integer

But that is also a field name. Advise not to name variables same as objects. That variable declaration is not needed since code references field/control with: Me.OrganisationUrn.
 
Last edited:

June7

AWF VIP
Local time
Yesterday, 23:15
Joined
Mar 9, 2014
Messages
5,468
OrganisationF has DataEntry property set to Yes. This prevents display of existing records but apparently DoCmd.OpenForm code overrides this to display data.

The acFormReadOnly prevents editing of any data anywhere on that form including subforms.

I had to change DataEntry to No and remove acFormReadOnly to allow filter to desired organisation and subform edits.
 
Last edited:

AlliCarr

New member
Local time
Today, 08:15
Joined
Feb 19, 2024
Messages
11
OrganisationF has DataEntry property set to Yes. This prevents display of existing records but apparently DoCmd.OpenForm code overrides this to display data.

The acFormReadOnly prevents editing of any data anywhere on that form including subforms.

I had to change DataEntry to No and remove acFormReadOnly to allow filter to desired organisation and subform edits.
Brill! That's fixed it.

Thank you so much for your help. :D
 

Users who are viewing this thread

Top Bottom