Results 1 to 4 of 4
  1. #1
    Battlescar is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    18

    Updating form name into a subform


    Hi
    When I update a form Name(SurveyName) in he main form. I want it also update the Subform with the same name.
    I have attached a few pics of what I am trying to do. So if I rename the SurveyName in the mainform from Test1 to Test3. I want it to update the Subform Names to Test 3. For those records with the same SurveyListID_FK And update all the records with the same name in the table EQSurveyListSubform as well.
    Attached Thumbnails Attached Thumbnails Capture.PNG   Capture2.PNG   Capture3.PNG   Capture4.PNG  

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    run an update query ,using the query in the subform.
    update to the item changed in the main form.

    If the subform query is qsSubformData
    then your update query would be:
    update [qsSubformData] set qsSubformData.[field] = forms!MainForm!txtBox

    if the item you are changing is the key, (bound to the subform)
    then no query is needed. alterning the master key will alter the subform keys automatically. (if you set relationships correctly)

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    When I update a form Name(SurveyName) in he main form. I want it also update the Subform with the same name.
    this is bad practice, data should only be stored once - in this case in your tblsurveylist table.

    You are already storing the FK, so all you need in your surveyyears form is a combobox, bound to the surveylistID_FK with a rowsource of

    SELECT SurveyListPK, surveyName FROM tblsurveylist

    Hide the first column so you will see the SurveyName, and lock the control so it cannot be changed from the subform

    If you change the name in the mainform, just requery the subform to refresh the data being viewed

  4. #4
    Battlescar is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    18
    Quote Originally Posted by ranman256 View Post
    run an update query ,using the query in the subform.
    update to the item changed in the main form.

    If the subform query is qsSubformData
    then your update query would be:
    update [qsSubformData] set qsSubformData.[field] = forms!MainForm!txtBox

    if the item you are changing is the key, (bound to the subform)
    then no query is needed. alterning the master key will alter the subform keys automatically. (if you set relationships correctly)
    So I took your advice and just created an update query. Works for me. Thanks.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-15-2017, 08:51 AM
  2. Replies: 10
    Last Post: 09-29-2016, 08:00 PM
  3. Replies: 2
    Last Post: 07-13-2016, 02:19 PM
  4. Replies: 4
    Last Post: 12-29-2014, 01:53 PM
  5. Updating Data in Form and SubForm
    By EddieN1 in forum Forms
    Replies: 1
    Last Post: 09-13-2012, 12:46 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