Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    sanderson is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    64

    Bound vs unbound checkboxes on a form

    Hello:



    I have a form that is driven by a query that looks at two tables. The data populates correctly.

    I have a textbox on the form that I can either bind to the fieldname in the query, or leave unbound.

    When I bind it, I cannot change the value.
    When I unbind it, changing the value represents changing all the values currently on the form. Of course, the data in the underlying table is not actually changed.

    I would like to simply click the box and have the table update, and potentially add some code behind it to change other things. There must be something stopping me from accomplishing this. My gut feeling is that I would need to unbind the control and have code change the actual table, which I am fine with. However, because I cannot check the boxes individually, I cannot get to this point.

    Thanks in advance.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The field name in the query is simply a yes/no field in the table? Not an expression or something? If a field in the table, can you change the value in the query? If not, I'm thinking that field is read-only in the query:

    http://allenbrowne.com/ser-61.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sanderson is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    64
    So if I were to leave it unbound and update information accordingly using event code, that should work? My problem is, when it is unbound and I select one item on the form, it selects all the items on the form. Basically, I am setting up an approval process for lines on a form, and might not want to approve everything.

    Thanks for your reply this far!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Unbound controls behave as you describe; same value for all records. It could be bound, but use code to update the value and requery the form if you can't get the query to be update-able.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    What is the Control Source for the bound checkbox field? Is it Enabled? Locked?
    When you say that you can't change the value, do you mean that when you click on the checkbox that the check doesn't appear, or that the value in the table didn't change?

  6. #6
    sanderson is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    64
    So I believe I have all this information somewhat local and it should display the control to mean what it is. The control sources are the actual field name for Approved and Approve, yet Approved prefers to display as not checkable.

    Click image for larger version. 

Name:	frmApproval.png 
Views:	35 
Size:	46.6 KB 
ID:	21736

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    A form can usually do data entry/edit for only 1 table. Use form/subform arrangement for data entry/edit to multiple tables.

    Apparently the form has a RecordSource with multiple tables which is causing it to not be editable.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    for the scenario you have indicated, you need an 'approved' field in your table bound to the approved control on your form

    Alternatively you need to create an ado recordsource for your form which includes the recordset plus the 'approved field', then some vba code to run when the option is 'ticked'

    here is a link on how to create an ado recordset for this purpose

    http://www.databasejournal.com/featu...Recordsets.htm

    personally I would think you want the approved field in your table so you have a record that it has been approved, but up to you

  9. #9
    sanderson is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    64
    The field is bound, and there is only one table. This is the Recordsource query...

    Code:
    SELECT tblocalApprovalLog.empid, tblocalApprovalLog.weekDate, tblocalApprovalLog.approved, tblocalApprovalLog.approve
    FROM tblocalApprovalLog
    WHERE (((tblocalApprovalLog.weekDate)=[Forms]![frmTimeCard].[txtPeriodStart].[Value] & " - " & [Forms]![frmTimeCard].[txtPeriodEnd].[Value]) AND ((tblocalApprovalLog.dayDate)=[Forms]![frmTimeCard].[txtDate].[Value]));

  10. #10
    sanderson is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    64
    I have met all of the criteria here: https://support.office.com/en-za/art...rs=en-ZA&ad=ZA

    and I still cannot edit the field on my form...

  11. #11
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    What happens if you remove the where part of your recordsource query?

  12. #12
    sanderson is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    64
    I get more data than I need, and the control is still not editable.

  13. #13
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    If you open the table tblocalApprovalLog, is the Approved checkbox editable?
    Does the Approve checkbox work ok in the form?

  14. #14
    sanderson is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    64
    Both are set for enabled yes, locked no. Yes, the Approve checkbox works fine.

    I have attached the db for you, if interested. Just look at tblocalApprovalLog and frmApproval. Some tables will not work because they are linked, but these are local to the application.

    Thanks
    Attached Files Attached Files

  15. #15
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Testing and debugging difficult without being able to open frmTimecard. I had to remove all references to frmTimeCard and disable the form Load event code.

    Editing checkboxes not an issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 11
    Last Post: 10-23-2014, 11:12 PM
  2. Replies: 2
    Last Post: 06-07-2013, 09:21 AM
  3. unbound vs bound in my form
    By broecher in forum Forms
    Replies: 5
    Last Post: 11-17-2012, 07:53 PM
  4. Unbound textbox in bound form
    By Evilferret in forum Forms
    Replies: 5
    Last Post: 08-15-2012, 01:26 PM
  5. Replies: 0
    Last Post: 05-09-2010, 08:43 AM

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