Results 1 to 4 of 4
  1. #1
    newbieX is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    111

    populate unbound checkbox using sql as rs


    I have a form that has a combo box that after update generates a sql that grabs the matching record in a table and returns its fields. All the textboxes are correctly populated but the check boxes are not checked on the form but are checked from the table they sql string was pulled from.


    Code:
    varOwnerID = cboOwnerName.Column(0)
    strSQL = "SELECT Owner.* FROM Owner WHERE [Owner.OwnerID]= " & varOwnerID
    Set rs = dbs.OpenRecordset(strSQL)
        txtOwnerName = rs!OwnerName
        txtAddress = rs!Address
        chkActive = rs!Active
        chkReview = rs!Review
        txtOwnerComments = rs!OwnerComments
    rs.Close
    Set rs = Nothing
    How can I modify my script to populate the check boxes with the correct value?

    Many thanks.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Why do you need code to populate fields? Why not bound form and then code 'goes to' record or applies filter?

    Cannot replicate issue.

    Set a breakpoint and step through code. Do the recordset fields have True or False value expect?
    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.

  3. #3
    newbieX is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    111
    Ok. I always (almost obviously) preface my check box names with chk but this time I had them as txt so much to my chagrin, the error was in referencing my check boxes. Thanks for trying to help.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Use Me. prefix and the intellisense popup can help reveal those errors.
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to get Checkbox to populate an associative table
    By tbbrown32 in forum Programming
    Replies: 14
    Last Post: 01-06-2016, 11:16 AM
  2. populate unbound field
    By DCV0204 in forum Access
    Replies: 3
    Last Post: 03-16-2012, 02:41 PM
  3. Unbound checkbox's that update
    By Madmax in forum Forms
    Replies: 5
    Last Post: 06-20-2011, 02:56 PM
  4. Checkbox to populate one table to another
    By glasgowlad1999 in forum Forms
    Replies: 1
    Last Post: 02-09-2011, 07:47 PM
  5. Populate checkbox
    By Ashe in forum Forms
    Replies: 9
    Last Post: 01-03-2011, 09:43 AM

Tags for this Thread

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