Results 1 to 7 of 7
  1. #1
    SusanCoder is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    34

    Is it possible to use the same table for both subforms?

    Thank you in advance for your advice.



    I have a mature, existing continuous subform named ServicesSubTable subform supported by a query from table ServicesSubTable (I inherited the subfrm and table names!). The subfrm has the following controls with their table attributes: UniqueID (identifies a person, primary key, required, AutoNumber), DateOfService (required, Date), Service (required, text) ServiceType (required, text), ILSpecialistName (required, text).

    My client has requested a new continuous subfrmTrsnMeetings that allows record add, update and deletes. They want the following controls with their table attributes: TrsnID (row ID, co-primary key, required, Number?), UniqueID (co-primary key, required, AutoNumber), TrsnMeetingDate (not required, Date), TrsnMeetingDateSpec (not required, Text), TrsnMeetingCompleted (not required, Date), TrsnMeetingCompletedSpec (not required, Text), TaskEmailSent (not required, Date), TaskEmailSentSpec (not required, Text), NextMeetingEmailSent (not required, Date), NextMeetingEmailSentSpec (not required, Text).

    Here's the requirement that is also stumping me...they want only the TrsnMeetingDate and it corresponding TrsnMeetingDateSpec data on this subfrm to show up on the ServicesTable subfm, where the subfrmTrsnMeetings' Date value would be the ServiceSubTable DateOfService value, and the subfrmTrsnMeetings' subfrxxxSpec value would be the ServiceSubTable ILSpecialistName value, with Service = "Service", ServiceType = "Transition Meeting".

    The client wants the subfrmTrsnMeetings fields/controls in this specific order in a row so a value for each field with can be added, deleted, or updated independently. Not every Date field with it's corresponding Spec (ILSpecialistName) field will be populated. The client wants the Date values and corresponding xxxSpec values for only the TrsnMeetingDate and it corresponding TrsnMeetingDateSpec to be reflected on the ServiceSubTable subform every time those values in the subfrmTrsnMeetings change.

    My question: If I add the TrsnID field to the table ServicesSubTable is it even possible to use the table to store data for and populate the subfrmTrsnMeetings? And wouldn't the data only be added, deleted, or updated on the subfrmTrsnMeetings where the TrsnID would be incremented with vba code?

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,820
    What you are suggesting in this paragraph is just wrong:-

    "My client has requested a new continuous subfrmTrsnMeetings that allows record add, update and deletes. They want the following controls with their table attributes: TrsnID (row ID, co-primary key, required, Number?), UniqueID (co-primary key, required, AutoNumber), TrsnMeetingDate (not required, Date), TrsnMeetingDateSpec (not required, Text), TrsnMeetingCompleted (not required, Date), TrsnMeetingCompletedSpec (not required, Text), TaskEmailSent (not required, Date), TaskEmailSentSpec (not required, Text), NextMeetingEmailSent (not required, Date), NextMeetingEmailSentSpec (not required, Text)."

    This section is a Repeating Group and should be records in a related table vice fields in the Transaction Table:
    "TaskEmailSent (not required, Date), TaskEmailSentSpec (not required, Text), NextMeetingEmailSent (not required, Date), NextMeetingEmailSentSpec (not required, Text)."

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    I have a mature, existing continuous subform named ServicesSubTable subform supported by a query from table ServicesSubTable
    Can you tell us about the master form that this subform is on?
    Can you post a copy of your db?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Should "to show up on the ServicesTable subfm" be "to show up on the ServicesSubTable subform"?

    These Trsn fields are in another table? How are these tables related? What does " subfrxxxSpec" mean? I am not following purpose of "co-primary" key setup.

    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.

  5. #5
    SusanCoder is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    34
    Quote Originally Posted by Bob Fitz View Post
    Can you tell us about the master form that this subform is on?
    Can you post a copy of your db?
    Bob Fitz, mike60smart, and there's one other person who responded...thanks to all who replied to my thread. Sorry it wasn't clear. I've created an attachment with snapshots of forms and info about the tables, etc. Some of the subform's data fields and label names have been hidden. I can't share the DB because of confidentiality and proprietary obligations.

    Please refer to the attachment. Warning: I know some of the table and form names are bit wackadoo, but please don't hate. The creators were good people. I inherited this database and kept on going with a new naming convention for anything I created. I bolded object names in the attachment and below for ease of understanding. Yes, ServicesSubTable subform is the complete name of a subform that I inherited. I use the prefixes "subfrm" and "tbl" and no spaces for the object names I create.

    My two options, as I see them, to create the new continuous subform subfrmTrsnMeetings:

    1. Use a query with existing table ServicesSubTable to populate the form. Add new fields as needed to the ServicesSubTable and store the new subform subfrmTrsnMeetings' TrsnMeetingCompleted field value for ServiceType as "Transition Meetings", because the ServicesSubTable already contains some of these records historically, and they are also displayed in the subform ServiceSubTable subform.


    • This is problematic for me because the new subform seems to require a composite primary key to keep the data ordered and in the correct rows. The table ServicesSubTable doesn't have a primary key or a composite primary key. Also, the new subform doesn't display all or part of the data from the ServicesSubTable, rather a row displays 4 iterations of DateOfService and ILSpecialistName fields, in pairs, where the ServiceType equals a different value for each of the four pairs. I don't know if this will even work when loading the data to the form. There are many existing queries, forms, and reports that use the ServicesSubTable's ServiceType field, including thousands of historical records.


    2. Create a new table tblTransitionMeetings with the fields used in the new subfrmTrsnMeetings and use a query of the new table for the record source for the new subform.

    • This is problematic for me because of having one of the data fields and it's record stored on two tables. The data from one of the DateOfService and ILSpecialistName pairs (TrsnMtgCompleted and TrsnMtgCompletedSpec where ServiceType = "Transition Meeting") needs to also be stored on the ServicesSubTable. It's the only one of the pairs that has to be on both tables. I'm not sure where in the subfrmTrsnMeetings to capture the current record values and then the updated records values to update the ServicesSubTable, or how that is done. And I've always designed tables and forms so data fields and their records reside on one table only.


    New subfrmTransitionMeeting 6.24.2024.pdf

    Thanks for your advice on which option to choose in creating the new subfrmTrsnMeetings. I appreciate you!

    Susan
    Last edited by SusanCoder; 06-25-2024 at 06:55 AM. Reason: uploaded attachment correctly

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    No attachment?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    SusanCoder is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    34
    Thank you, Welshgasman. I didn't realize the attachment hadn't uploaded. The attachment is now showing in the thread.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-31-2020, 05:02 PM
  2. Subforms Inside Subforms
    By LordPanzer in forum Access
    Replies: 1
    Last Post: 10-11-2013, 05:19 PM
  3. Save subforms filtered results to table.
    By lewis1682 in forum Programming
    Replies: 33
    Last Post: 09-15-2013, 09:43 PM
  4. Replies: 1
    Last Post: 07-30-2012, 03:13 PM
  5. Replies: 2
    Last Post: 02-11-2012, 09:41 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