Results 1 to 5 of 5
  1. #1
    rawlstonb is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Nov 2018
    Posts
    55

    Checkbox to Populate Linked Table with Redundant Data

    I'm working on essentially an external add-on to an existing database. I've got many fields on a form that populate the local database's 'tblRouterData' table. The 'Submit' button populates all the fields in that table and sends an e-mail for notification of task completion, but I need a check box on that form that will initialize a select few of those fields to also populate in the linked database's Main table as an optional secondary Control Source...



    Secondary Populate Fields for Linked Table 'Main':

    txtAuthor -> Main.Work Order Prep Person
    (name)
    txtStartDate -> Main.Work Order Start
    (date)
    txtFinishDate -> Main. Work Order Finish
    (date)
    chkLineItemComplete -> Main.Work Order Complete
    (checkbox)

    The tables are linked through tblRouterData.SO# -> Main.Sales Document

    If any more information is needed I'll be happy to provide it. So note, I'm novice-level at best... especially with code I don't understand, so notes as to why code is needed where are super-helpful to me.

    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    the button click can run a separate query before /after the main query

    if chkBox.value then docmd.OpenQuery "quUpdateFlds1"
    docmd.OpenQuery "quUpdateFlds2"

  3. #3
    rawlstonb is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Nov 2018
    Posts
    55
    Quote Originally Posted by ranman256 View Post
    the button click can run a separate query before /after the main query

    if chkBox.value then docmd.OpenQuery "quUpdateFlds1"
    docmd.OpenQuery "quUpdateFlds2"
    That sounds wonderful... and probably exactly what I need to do!

    So, where do I put that and what queries do I need to create?

    Yes, I'm serious unfortunately lol

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    in the button click event

    Code:
    sub btnRun_click()
    if chkBox.value then docmd.OpenQuery "quUpdateFlds1"
    docmd.OpenQuery "quUpdateFlds2
    end sub
    

  5. #5
    rawlstonb is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Nov 2018
    Posts
    55
    Click image for larger version. 

Name:	Capture.JPG 
Views:	6 
Size:	39.6 KB 
ID:	36187

    I don't want to have to backtrack too far and pull the e-mail code and get super-confused again... is this going to work?

    I used the query wizard to set up "qryUpdateMain" which pulls the things that need updating from table main but I don't see how they're going to connect to the fields that are updating them as is... all it does is open the query



    Edit: OK I set the Value = -1 and the query opens on check and doesn't on not checked, so this should theoretically work... I just need to know how to set up the query itself to update the Main table in the correct places with the correct values

    Edit Again: Looked up update query and I think I got this... thanks

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. Replies: 9
    Last Post: 10-20-2014, 04:00 PM
  3. Replies: 2
    Last Post: 04-15-2014, 10:03 PM
  4. Access support for checkbox against linked table
    By jprotivnak in forum Access
    Replies: 7
    Last Post: 01-30-2013, 07:50 AM
  5. Checkbox to populate one table to another
    By glasgowlad1999 in forum Forms
    Replies: 1
    Last Post: 02-09-2011, 07:47 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