Results 1 to 5 of 5
  1. #1
    the1gofer is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2019
    Posts
    3

    forms and subforms

    I have a Main form which is linked to a sub from. Can I set some of the fields in the subform to be equal to fields in the main form, then hide them? It's not since the fields aren't in both tables, I can't just link them, and the sub form seems to ignore hidden fields, unless I delete them.


    Hope that makes sense.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    A subform is generally linked to a main form via one common field (Master/Child relationship) rather than several as you seem to be doing, or am I wrong about that?
    the sub form seems to ignore hidden fields, unless I delete them
    Obviously a form cannot help but "ignore" fields that aren't there so I must be missing that point.
    Last edited by Micron; 08-17-2019 at 07:45 AM. Reason: duplication
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I concur with Micron --but not understanding the requirement in general. The form/subform construct in Access is often used to display data from tables that are in a 1 to many relationship. (eg A Person (1) may have many(M) Hobbies). The tables have a field in common (eg PersonID) and that common field is used to link mainform and subform.
    You are telling us about your form subform. Perhaps you should tell us WHAT you are trying to do in simple terms, and then let readers advise HOW it might be accomplished.

  4. #4
    Join Date
    Apr 2017
    Posts
    1,673
    Quote Originally Posted by Micron View Post
    A subform is generally linked to a main form via one common field (Master/Child relationship) rather than several as you seem to be doing, or am I wrong about that
    You are wrong about that!
    You can have any number of master field - child field pairs in subform LinkMasterField/LinkChidField properties, separated by your list separator (semicolon or comma). Is it reasonable or not, depends on situation.
    You also can have unbound controls in master form as LinkMasterField (but not for LinkChildField). Access will protest, but only because it doesn't know it can do this! But you have to create the link manually!

    When linked fields in master and child tables have different names, then it is also easier to set link manually.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    been away so this is late
    You can have any number of master field - child field pairs
    I didn't say not possible, I said not usually done.
    Is it reasonable or not, depends on situation.
    After saying I'm wrong, you practically say the same thing.
    Notice the lack of exclamation marks in my reply. That means I'm not so emphatic, which in turn means I'm not enjoying pointing things out so much.

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

Similar Threads

  1. Forms & Subforms
    By Poohbear0471 in forum Forms
    Replies: 2
    Last Post: 05-03-2019, 05:41 AM
  2. Forms & Subforms
    By kid_viciouss in forum Forms
    Replies: 3
    Last Post: 11-30-2016, 04:00 PM
  3. Forms and Subforms
    By Smtz in forum Forms
    Replies: 1
    Last Post: 09-25-2013, 04:19 PM
  4. Replies: 5
    Last Post: 01-16-2013, 03:48 PM
  5. Help with Forms and Subforms
    By xstaceyid in forum Forms
    Replies: 1
    Last Post: 04-21-2011, 02:14 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