Results 1 to 9 of 9
  1. #1
    gensor is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    5

    Subform link to another subform

    Hello,



    I'm currently "trying" to do a business management software using access and had some problems with it. This software would have client form, orders, product inventory, ...

    The first one I'll describe is that in my client's form, there's an ID field. In the form, there's a subform that will list all the orders from this client linked with the client number on the main form. I want to have a second subform that is showing the products bought in the order clicked on the first subform. This second subform have to be linked with the order number in the first subform.

    Right now, I'm not using VBA for this. The first subform has been configured with the assistant, I choosed in the list the field I want to link but in the second subform, the assistant doesn't allow me to link on first subform.

    What am I doing wrong ?

    Also, anyone have a example of project like that I could take parts of it ?

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    You need to create a fake Master field related to your first sub form and use it to relate it to second sub form. See this link for step by step process http://www.fmsinc.com/microsoftacces...edsubforms.asp

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    If sub form #1 is continuous mode (rows of data) then it is not able to have a sub form... that is just a fundamental reality of design.

    Make Orders the main form; inset Customer as a sub form, and inset products as a sub form.

  4. #4
    gensor is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    5
    Just to be sure what you mean, I could have for example, a hide field on the form in which I could copy the Order Number of the first SubForm.
    I could then use the assistant to link the second subform to this field.

    At start, the subform will be empty but I could use an event on click to copy the number of the form, and then requiry the second sub.

    Is it what you mean ?

  5. #5
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Just to be sure what you mean, I could have for example, a hide field on the form in which I could copy the Order Number of the first SubForm.
    I could then use the assistant to link the second subform to this field.
    No, you need to manually enter the name of control and child field of sub form. Create a hidden textbox on Main form named txtOrderID and set its control source to the Order number field on your first sub form. In design view, select the subform2 and on the Data Tab of the Property sheet, enter txtOrderID as Link Master fields and the related OrderDetail field as Link Child fields.

  6. #6
    gensor is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    5
    How can I link a subform to a control on the main form ? In the assistant, there's only possibility of table field from the source of the main form

  7. #7
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    I already mentioned in #2, do not use assistant.
    No, you need to manually enter the name of control and child field of sub form. Create a hidden textbox on Main form named txtOrderID and set its control source to the Order number field on your first sub form. In design view, select the subform2 and on the Data Tab of the Property sheet, enter txtOrderID as Link Master fields and the related OrderDetail field as Link Child fields.

  8. #8
    gensor is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    5
    Is it possible that this property doesn't exists in Access 2013 ? Mine is in French and I don't see anything about master or child link. This is why I'm using the assistant

  9. #9
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Click image for larger version. 

Name:	PropertySheet.jpg 
Views:	12 
Size:	35.0 KB 
ID:	20039
    Does above exists in Access 2013 ? In design view, select sub form2 and Press F4 to bring up the property sheet, go to Data tab

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

Similar Threads

  1. subform image link
    By anchamal in forum Forms
    Replies: 3
    Last Post: 01-15-2014, 12:35 AM
  2. Link between subform and mainform
    By crowegreg in forum Forms
    Replies: 2
    Last Post: 08-24-2011, 07:05 AM
  3. How to link subform using two fields
    By rohnds in forum Forms
    Replies: 1
    Last Post: 08-04-2010, 04:44 AM
  4. Replies: 1
    Last Post: 03-06-2010, 06:30 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