Results 1 to 4 of 4
  1. #1
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93

    Link two separate forms


    Hello Everyone
    A form and a subform are linked through Link Master Fields and Link Child Fields properties. So for example if you have an order form where you enter the order details for a customer and then you enter the products for that order in the subform. The data you enter in the main form goes inside the orders table and the data you enter in the subform goes inside the order details table. The magic happens inside the subform. You don’t have to enter the order ID in the subform so that it is entered in the order details table, the order ID is entered automatically in the order details form. But what if the data you want to show in the subform are too big for the subform and you want the subform to show in its own form. How do you link the two forms together so that you achieve the same effect that happens between the form and subform, meaning that you don’t have to enter the order ID in the second form ?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Synchronize two related subforms, review http://www.fmsinc.com/MicrosoftAcces...edSubforms.asp
    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
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93
    thanks for your reply June7,

    the link you posted is about linking two subforms, it is not what am looking for, am looking for linking two separate independent forms.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    If you want to link two forms that are open independently, not as subforms sitting on another form - well, Master/Child links are properties of subform container control, not the forms.

    I've never done it but might try setting DefaultValue property of foreign key field textbox on OrderDetails to reference the Orders form OrderID: Forms!Orders!OrderID Hmmm, just tried, sort of works. New Record row shows value from Orders that has record but changing to another Orders record does not change the default value on OrderDetails, have to close and reopen OrderDetails or complete that new record and move to another new record then the value does reflect change.

    Otherwise, use code to populate fields. Click a button "Add Product to Order" then code moves to new record row, refers to Orders form to grab the OrderID, populates OrderID into foreign key field, and sets focus on first control requiring user input such as quantity.
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 07-13-2018, 05:44 AM
  2. Replies: 3
    Last Post: 02-19-2018, 01:35 PM
  3. Select Case To Open Separate Forms
    By MdHaziq in forum Programming
    Replies: 6
    Last Post: 12-25-2017, 12:19 AM
  4. Replies: 5
    Last Post: 03-30-2013, 12:56 PM
  5. Auto update in separate forms
    By spleewars in forum Forms
    Replies: 8
    Last Post: 03-02-2012, 04:25 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