Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2005, 07:51 PM
Authorized User
 
Join Date: Feb 2005
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Default Form doesn't appear in object browser

Hi all,

I have a serious problem. I am trying to use the SetFocus method to move the cursor to a subform after I click a checkbox. The code seems pretty straightforward. This is my code:
SuppliesEntry.SetFocus

But for some reason, every time I click on the checkbox to test my code, I get an error that says it can't find the form named SuppliesEntry. Okay, so I go into object browser in the VBE and the form does not appear in there even though all the other forms do. And I know that the form is there because I made the form and I dragged on the other form as a subform. Needless to say I am getting :(. Can anyone please help me?

 
Old November 3rd, 2005, 08:39 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

There is a convoluted naming convention for referring to a subform. It is something like

Forms!MainFormName!SubFormName

You may need to look this up. I had a similar problem and even Alison Balter couldn't help, so I had to abandon the subform. I have seen other posters here post the syntax. Perhaps a search of this forum...

GL

mmcdonal
 
Old November 3rd, 2005, 12:32 PM
Authorized User
 
Join Date: Sep 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I beleive that the Forms!MainFormName!SubFormName is due to the fact that Access or VBA creates an instance of that sub-form which is connected to the main form.
If you use Form!SubFormName, that would imply that the sub-form is open on its own (which is possible).

This is the only way I can understand this.

You can create multiple instances of other Forms.
See Access 97 Developers book by Getz, et al.

 
Old November 3rd, 2005, 05:51 PM
Authorized User
 
Join Date: Feb 2005
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hi all,

I figured it out. The syntax is this:
Me.subFormName.SetFocus

And if you want it to be enabled by using a different control:
Me.SubFormName.Visible = Me.chkBoxName

This would be done on the AfterUpdate event for the control. Hope this helps out anyone.

 
Old November 8th, 2005, 05:39 AM
Authorized User
 
Join Date: Jul 2004
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

This is probably too late, but the following link SHOULD take you to a form on the AccessWeb where the full syntax of using subforms is tabulated. I have found this invaluable and keep it as hard copy wherever I work.

http://www.mvps.org/access/forms/frm0031.htm

The Article name is 'Forms: Refer to Form and Subform properties and controls' by Keri Hardwicke

HTH








Similar Threads
Thread Thread Starter Forum Replies Last Post
unistalling Browser Helper Object maricar C# 0 October 7th, 2008 08:53 PM
Sumit form without Browser. rodmcleay ASP.NET 2.0 Professional 1 May 27th, 2007 09:40 PM
View Source from ActiveX Browser Object echovue Access 4 November 1st, 2005 01:13 PM
Print web form in browser Roy Ng ASP.NET 1.0 and 1.1 Professional 1 July 15th, 2005 03:42 PM
Properties/Methods Not in Object Browser ritag VS.NET 2002/2003 0 January 13th, 2005 12:59 PM





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