Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Tippzee is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    12

    Checkbox added to sub-report cannot be checked or unchecked

    I am trying to add checkboxes to a subreport in my main report, so that my boss can indicate a check mark against the data after he has seen it. The subreport is created based on a query that pulls information from different tables, and has rows of names that can change on a weekly basis. I do not need the checkbox to serve any other function. Just to let my boss indicate that he has read that particular row, and the check mark can disappear if the row containing the name disappears.

    I've tried adding a checkbox using the Controls function, but the checkbox is greyed out (I.e. Cannot be checked or unchecked) when I run the subreport in Report View. However, the checkbox works if I place it in the main report instead of the subreport. I need to have the checkbox in the subreport as the rows of names are based on the query used to generate the sub report.



    How do I get the checkbox in my subreport to work? It is enabled, and is visible. Please help!!

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Is this an unbound checkbox - not bound to a specific field? If so, it will behave as you describe.
    If it is bound to a field, does it have a default value whether true or false? If not, add the default.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Tippzee is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    12
    Yes, it's unbound as I did not intend to link it to any fields. Silly question, how do I bound it to a field in this case? Is it by adding a control source based on an empty table with two data - e.g. Y and N?

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Quote Originally Posted by Tippzee View Post
    Yes, it's unbound as I did not intend to link it to any fields. Silly question, how do I bound it to a field in this case? Is it by adding a control source based on an empty table with two data - e.g. Y and N?
    No.
    Add a Boolean (Yes/No) field to the table containing the names so each record contains a name together with true/false value.
    Use that field as the control source for your checkbox
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Tippzee is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    12
    Quote Originally Posted by ridders52 View Post
    No.
    Add a Boolean (Yes/No) field to the table containing the names so each record contains a name together with true/false value.
    Use that field as the control source for your checkbox
    Thanks for the advice! I tried adding a Boolean field to the table and then pulled the field to my query (which the subreport is based on), then I created the checkbox with the new field as the control source. However, I am still unable to select the checkbox. The only difference is that the checkbox is now white instead of greyed out, but i still cannot click on it. Am I missing something?

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Quote Originally Posted by Tippzee View Post
    Thanks for the advice! I tried adding a Boolean field to the table and then pulled the field to my query (which the subreport is based on), then I created the checkbox with the new field as the control source. However, I am still unable to select the checkbox. The only difference is that the checkbox is now white instead of greyed out, but i still cannot click on it. Am I missing something?
    3 possible reasons.
    1. The checkbox is locked
    2. The subform is locked
    3. The subform is read only.

    The most likely cause is the last of these. If so you will need to alter your subform record source to make it editable
    It's unlikely that the Boolean field itself is the cause
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    Tippzee is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    12
    Quote Originally Posted by ridders52 View Post
    3 possible reasons.
    1. The checkbox is locked
    2. The subform is locked
    3. The subform is read only.

    The most likely cause is the last of these. If so you will need to alter your subform record source to make it editable
    It's unlikely that the Boolean field itself is the cause
    im placing the checkbox in a subreport though, not a subform. The source of the sub-report is a query, which is editable. However, the sub-report does not allow edits to the data. How do I remove the read-only?

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Apologies hadn't noticed that in your previous post and it seems not even read the thread title!

    Reports are not normally interactive though some LIMITED interaction such as a button click is possible in REPORT view.

    Suggest this is done using a form/subform instead which are designed to be interactive i.e. editable
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #9
    Tippzee is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    12
    Ah i was hoping to avoid the use of forms, as the report that I am trying to insert the checkbox in contains more than 20 sub reports, all of which require the checkbox. I just need that limited interaction of a button click though. No need for any further action to be activated based on that click on the checkbox. How can I enable this in my report? The checkbox I added works in the main report, but somehow becomes uneditable when it is in the subreport.

  10. #10
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You realize this functionality, assuming you get it to work, is useless if the report is mailed/printed? That's probably the main reason why it's uncommon to interact with reports this way. If you're going to say that he/she always will look at this via using the db, then I'm afraid your hesitation for not using a form makes no sense to me - especially when clicking this checkbox can record in a db table that it has been reviewed. Plus, it's easy to undo if someone changes their mind.

    If you must have it as a report, then what I'm not seeing here is if you can get it to work by opening the subreport directly instead of trying to interact with the sub when the main report is open. If you can, then maybe a reference between the main report and sub is the issue, but I'm not getting a sense of that from your posts. 20 subreports on a report seems a bit excessive as well, but maybe that's not as uncommon as I think it is.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    Tippzee is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    12
    Quote Originally Posted by Micron View Post
    You realize this functionality, assuming you get it to work, is useless if the report is mailed/printed? That's probably the main reason why it's uncommon to interact with reports this way. If you're going to say that he/she always will look at this via using the db, then I'm afraid your hesitation for not using a form makes no sense to me - especially when clicking this checkbox can record in a db table that it has been reviewed. Plus, it's easy to undo if someone changes their mind.

    If you must have it as a report, then what I'm not seeing here is if you can get it to work by opening the subreport directly instead of trying to interact with the sub when the main report is open. If you can, then maybe a reference between the main report and sub is the issue, but I'm not getting a sense of that from your posts. 20 subreports on a report seems a bit excessive as well, but maybe that's not as uncommon as I think it is.
    Thank you for the suggestion! You're right, the checkbox can be checked and unchecked when I open the subreport directly. However, as there are many names in the subreport, the checkbox now becomes checked / unchecked for all names (I.e. The user cannot check the checkbox for only those names that he/she wants to indicate). Two issues here - (1) how do I fix the reference between the main report and the subreport; (2) how do i set the checkbox properties such that I can check/uncheck certain names?

    to provide some context why there are so many sub reports, the report is mainly on personnel changes, which each subreport showing a particular category e.g. Who are those on leave, who are those on course, with different fields reflected in each subreport (only common field is name).

  12. #12
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    The only difference is that the checkbox is now white instead of greyed out, but i still cannot click on it
    This implies that the control isn't updatable per post 6 bullet 3. This could be caused by any of several reasons.
    Two issues here - (1) how do I fix the reference between the main report and the subreport; (2) how do i set the checkbox properties such that I can check/uncheck certain names?
    1 - I've scanned this thread more than once and can't find anything that suggests there is such a link, much less what it is or how to fix it. The syntax for referencing a subform control is
    Code:
    [Forms]![Main form name]![subform control name].[Form]![control name on subform]
    You should be able to adapt this for reports/subreports. NOTE: subformControlName the name of the CONTROL that contains the subform.

    To reference a subform property, I usually use, for example
    Code:
    Forms("Main form name").Controls("subformControlName").Form.Property
    I had issues with the former syntax and never bothered to figure out why.

    2 - I have no answer as I would never try to do what you're doing. Reports were not made for this purpose and I think you're just asking for grief in trying to make them into some sort of form - which is what you're doing. As mentioned, you cannot expect it to work if the report user is not even in the db at the time, which I asked about but didn't seem to get an answer. What you'd be asking for is Word or Acrobat PDF forms functionality. If you're boss is hung up on the report because of how it looks, then make a form that looks just like it. Otherwise, I think you're wasting your time. Sorry.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  13. #13
    Tippzee is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    12
    Hi Micron, thank you for taking the time to explain to me, really helps as I am very new to Access so I'm trying all I can to learn.

    I've tried creating a form, containing subforms. Each subform is based on a query that pulls names of staff that meet the criteria. Example sub form A is for staff on leave, subform B is for staff on course. These lists of names changes regularly based on what we update in the table which the queries are based on, since personnel changes happen frequently. However, I encounter the same issue where the checkbox is selected/unselected for all the names in that sub form. I cannot set the checkbox to be selected/unselected for specific names. Am I missing out anything that I should have done?

    Quote Originally Posted by Micron View Post
    2 - I have no answer as I would never try to do what you're doing. Reports were not made for this purpose and I think you're just asking for grief in trying to make them into some sort of form - which is what you're doing. As mentioned, you cannot expect it to work if the report user is not even in the db at the time, which I asked about but didn't seem to get an answer.
    Not sure what you mean by the report user is not even in the db at the time. The reader will have to open the db (where the tables, queries and forms/reports are in) in order to read the report. Have I interpreted you wrongly?

  14. #14
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Ok if you still can't edit this in a (sub)form then read post #6 again
    If the record source is read only, this link should help you identify the reason http://allenbrowne.com/ser-61.html
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  15. #15
    Tippzee is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    12
    Quote Originally Posted by ridders52 View Post
    Ok if you still can't edit this in a (sub)form then read post #6 again
    If the record source is read only, this link should help you identify the reason http://allenbrowne.com/ser-61.html
    I've drawn a checkbox beside the field "Name". The checkbox can be edited, but checking one checkbox leads to checking all the checkboxes beside the names in the subform. Similarly, unchecking one check box leads to unchecking all checkboxes beside the names. Is that how a checkbox supposed to function?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. hide record if checkbox is unchecked
    By enginerdUNH in forum Programming
    Replies: 2
    Last Post: 02-26-2018, 08:00 PM
  2. Replies: 7
    Last Post: 03-17-2016, 10:42 AM
  3. Print Checkbox on report only if checked
    By azhar2006 in forum Reports
    Replies: 5
    Last Post: 10-26-2014, 11:59 PM
  4. Replies: 4
    Last Post: 06-03-2014, 10:30 AM
  5. Replies: 3
    Last Post: 08-06-2012, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums