Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 10th, 2004, 05:22 PM
Registered User
Join Date: Feb 2004
Location: Houston, TX, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nimarii Send a message via Yahoo to nimarii
Default 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!!

Reply With Quote
  #2 (permalink)  
Old February 11th, 2004, 06:35 PM
Registered User
Join Date: Feb 2004
Location: Houston, TX, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nimarii Send a message via Yahoo to nimarii

i found out how to do it; this is how you would refer to it:
forms!NameOfMainForm!NameOfControlThatHoldsTheSubf orm.form!Control
forms!NameOfMainForm!NameOfControlThatHoldsTheSubf orm.form.Property
i was confused because the control that holds the subform is not the tab that it was on, or the page it was on, but totally separate. i had to click off, then right click on the subform to get the control name, which was different from the subform name.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Referencing a subform scandalous Access 2 March 16th, 2007 07:05 AM
Sights and Sounds in Access Forms SerranoG Access 1 October 11th, 2005 09:56 AM
Request: Sounds for Active Topics Snib Forum and Wrox.com Feedback 2 April 9th, 2004 04:11 PM
Sounds in Excel VBA selbybrock Wrox Book Feedback 0 December 13th, 2003 02:14 PM
Sounds in excel vba selbybrock Excel VBA 0 October 24th, 2003 09:42 AM

All times are GMT -4. The time now is 07:02 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.