Create a linked form using Access 2016
Channel: Computer Tutoring
Date: 2018-04-06

Create a linked form by using a button in Access 2016 can be a little bit of a thorny problem. This tutorial will show you how to link from an Orders sub form to a order details linked form. Using VBA you will learn how to pass data from one form to another. 
The code takes advantage of Open Arguments to pass data from one form to another.

The VBA code in the video is as follows:

Private Sub btnOrderDetails_Click()
DoCmd.OpenForm "frmOrderDetails", WhereCondition:="[orderID]=" & Me![orderID], WindowMode:=acDialog, OpenArgs:=Me.orderID
End Sub

Private Sub Form_Open(Cancel As Integer)
If Me.OpenArgs &#lt; &#gt; "" Then
    Me![orderID].DefaultValue = "" & Me.OpenArgs & ""
End If
End Sub

Find exercise files here: https://www.computertutoring.co.uk/ms-access-openargs.asp
#computertutoring 

😊 Check out my website and social media to keep up to date - enjoy learning 😊

 📱 http://www.computertutoring.co.uk/ 📱 
📽 https://www.tiktok.com/@thecomptutor 📽 
👨‍👩‍👧‍👦 https://www.facebook.com/ComputerTutoring.co.uk/ 👨‍👩‍👧‍👦 
🦉 https://twitter.com/CT_Tutoring 🦉 
📷https://www.instagram.com/computer_tutoring/ 📷 
📌https://www.pinterest.co.uk/CT_Training/ 📌