referencing a subform, more complex than it sounds
i'm trying to reference a subform, and i keep getting errors no matter what i try. they either can't find the subform, or the field i'm referencing.
What I'm trying to do is be able to "attach" a document on the user's machine to a table via a command button on a form. It should also be able to "Edit" existing attachments to change the name or path.
I have a button on a subform(f_orders_sub) that is linked to a text box where the attachment will show up. When the button is clicked, it will call the hyperlinkForm (completely separate form), which has a control that points to the attachment textbox. Everything works except for pointing the control to the textbox on the subform (should be marked in red)
Here's the partial code:
Option Compare Database
Option Explicit
Dim m_ctlHyperlink As Control
Private Sub form_load()
Set m_ctlHyperlink = Forms!f_order_details_form.Form.Controls(OpenArgs)
With m_ctlHyperlink.Hyperlink
txtDisplay = .TextToDisplay
txtAddress = .Address
txtSubAddress = .SubAddress
End With
End Sub
Any help would be greatly appreciated!!
|