Results 1 to 5 of 5
  1. #1
    taholmes160 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Location
    Lester, Ohio
    Posts
    67

    A Form/Subform combination that displays different subforms depending on the choice in the main form

    MERRY CHRISTMAS and HAPPY HOLIDAYS to one and all from the Holmes Family



    Hi All:

    This thread is LOOSELY related to 2 others:


    The database and input forms seem to be working quite nicely, and I am getting the reports together, so I have moved on to another part of the project.

    Being that this is a model railroad database, there can be a lot of paperwork associated with running each train. In model railroad parlance, we call these orders. Some are informational, containing instructions about how to operate a particular locomotive, or they can be maintainance related etc. each type has a specific set of instructions which can fit nicely in to 20 fields, so I have created a table that has 21 lines; OrderID_PK (the primary key and set auto number/long int), Field_1 - Field_19, and a field called instructions - All of them set as Short text.

    I know that I can create 8 different forms, and have done with it, but I'd like to see if I can do it a bit more classy.

    What I want to do is have a form where I use a combo or list box to select the type of form that I am populating, and have it pull up another form, or sub form or whatever that is appropriate to the type of order that I am creating. The problem is that I dont know how to do this, I SUSPECT that it would be a form/Subform combination (I know they are mostly used in a 1 to many relationship, but I suspect you could make the subform a regular form, and set it all for data entry)

    This thread is also posted in the UtterAccess form at: https://www.utteraccess.com/forum/in...wtopic=2051989

    Any input would be greatly appreciated

    TIM
    Last edited by taholmes160; 12-25-2018 at 02:39 PM. Reason: Added link to topic on UtterAccess Forums

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Not really understanding data structure for these 'instructions'. What you describe (Field_1 - Field_19) is not normalized. Don't really understand why there would be 8 forms. I would prefer filtering records over building 8 forms.

    Options:

    1. apply filter to subform to display desired record

    2. arrange 8 forms on pages of Tab control

    3. use Navigation form

    4. code sets the SourceObject property of subform container control
    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
    taholmes160 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Location
    Lester, Ohio
    Posts
    67
    HI June7:

    All the info in the fields is simply straight text -- things like Function 0 = Headlight, Function 1 = Bell etc. the last field is always instructions, and its labled as such, so that gives 20 fields for different instructions / information and the Primary Key field.

    There would be 8 forms because the different types of reports that are generated have different labels on the different fields, it would be either that or 8 different tables, which I would prefer not to do b/c they would all be mostly identical.

    What I am hoping to do is to be able to open the main form, and choose the type of order form that will be printed -- for example a engine order form would have the following:

    OrderID_PK 001
    Field_1 199
    Field_2 SLRG
    Field_3 2006
    Field_4 8
    Field_5 SD40
    Field_6 ROad Switcher
    Field_7 2000
    Instructions - Front Coupler does not latch securely


    The input form for an engine order would have the following Lables:

    Field_1= Train #
    Field_2= Road Name
    Field_3= Road Number
    Field_4= DCC Address
    Instructions

    The labels on the report would be the same and would be formatted specifcally for that type of order

    I know I can do this with 8 separate forms, I was trying to make it all look real classy and nice

    TIM

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Label captions can be dynamic with code or use textboxes to act as 'labels' and again code can change what is displayed or even bind them to a field that has 'caption'.

    However, already offered 4 options, 3 of which require building 8 forms. Which do you like?

    Oh, I didn't include the option of opening as independent form, not subform, but you seemed to already be aware of that and again, have to build 8 forms.
    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
    taholmes160 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Location
    Lester, Ohio
    Posts
    67
    Hi June 7:

    I think I am going to go with 8 forms on tabs, and I am going to go with 8 different tables as well, to minimize the risk of data damage as a result of non-normalization

    Thanks for the help
    TIM

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

Similar Threads

  1. Replies: 3
    Last Post: 06-29-2017, 03:02 PM
  2. Replies: 3
    Last Post: 06-24-2017, 06:39 PM
  3. Replies: 7
    Last Post: 02-02-2017, 05:01 PM
  4. Replies: 1
    Last Post: 03-03-2016, 05:23 PM
  5. Replies: 11
    Last Post: 05-13-2015, 11:10 PM

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