A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find Name of Subform?



 
 
Thread Tools Display Modes
  #1  
Old July 26th, 2006, 01:45 AM posted to microsoft.public.access.forms
Robert T
external usenet poster
 
Posts: 225
Default Find Name of Subform?

Hello:

I created a query and then made it a subform. Everything works well except
the ability to requery the subform. When I try to compile the script, I
receive an error because I apparently have the wrong name of the subform
[using the caption].

OK, so I clicked on the subform's properties and looked everywhere, however,
I cannot find the name of the subform. This has happened before. Am I missing
something obvious?

Thanks,
Robert
  #2  
Old July 26th, 2006, 01:51 AM posted to microsoft.public.access.forms
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default Find Name of Subform?

Open main form. Click on top edge of control that holds the subform. Open
Properties window. Click on Other tab. Name will be in the Name box.

--

Ken Snell
MS ACCESS MVP

"Robert T" wrote in message
...
Hello:

I created a query and then made it a subform. Everything works well except
the ability to requery the subform. When I try to compile the script, I
receive an error because I apparently have the wrong name of the subform
[using the caption].

OK, so I clicked on the subform's properties and looked everywhere,
however,
I cannot find the name of the subform. This has happened before. Am I
missing
something obvious?

Thanks,
Robert



  #3  
Old July 26th, 2006, 02:19 AM posted to microsoft.public.access.forms
Robert T
external usenet poster
 
Posts: 225
Default Find Name of Subform?

Hello Ken:

Thanks, I tried that technique and found the subform name. But I don't get
it, how in the world would anyone know that trick? Why isn't the form name
listed with the other properties of the subform?

Thanks,
Robert


  #4  
Old July 26th, 2006, 04:49 AM posted to microsoft.public.access.forms
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default Find Name of Subform?

A subform is contained within a subform control on a main form. So that
subform control has all the properties of the subform object -- the name,
data linking fields, etc. The actual name of the form that is serving as the
subform is found in the subform control's Source Object property.

A subform is not actually open in its own right, and actually many forms can
use the same "subform" -- hence, a subform itself does not contain
properties that are directly pertainable to the subform control because
those properties would change for each main form.

In ACCESS, the subform is a child of the main form, hence you must reference
the subform through the main form, just as you would a textbox control on
the main form.

Let me know if I've not answered your question clearly -- I'm currently
finishing up a 16-hour workday and I'm not sure if I'm making sense.... g


--

Ken Snell
MS ACCESS MVP


"Robert T" wrote in message
...
Hello Ken:

Thanks, I tried that technique and found the subform name. But I don't get
it, how in the world would anyone know that trick? Why isn't the form name
listed with the other properties of the subform?

Thanks,
Robert




  #5  
Old July 26th, 2006, 04:52 AM posted to microsoft.public.access.forms
Larry Linson
external usenet poster
 
Posts: 3,112
Default Find Name of Subform?

"Robert T" wrote

Thanks, I tried that technique and found
the subform name.


Actually, you found the name of the Subform Control.

But I don't get it, how in the world would
anyone know that trick?


It's not a "trick" -- it is the same identical way you find the name of any
other Control. One would learn this when learning the basics of Access,
using self-study books, or online training (see http://office.microsoft.com
and other providers), or, well, asking in newsgroups such as this one.

Why isn't the form name listed with the
other properties of the subform?


The name of the Form embedded in the Subform Control can be found as the
SourceObject property, but it is of little/no use because you do not refer
to the embedded Form by name. From the main Form's code, you refer to a
Control (txtA) in the Form embedded in the SubformControl (sbfB) like this:

Me!sbfB.Form!txtA

(the "!"s in this statement can be replaced with "." if you prefer, but the
"." between sbfB and "Form" cannot be replaced by a "!", because Form is a
Property of the Subform Control, not a member of a Collection).

You don't requery the Form that is embedded in the Subform Control, you
requery the Subform Control itself. The embedded Form is not "open" when
displayed in the Subform Control -- you will not find it in the Forms
collection.

By now, maybe my trying to be very precise in nomenclature has already led
to you realize: There is no Access object called a "Subform"; there is a
Subform Control, into which a Form can be embedded -- we sometimes take the
shortcut of just calling the Subform Control and its embedded Form a
"Subform" but that can be confusing, as it seems to have been for you.

Larry Linson
Microsoft Access MVP


  #6  
Old July 26th, 2006, 02:21 PM posted to microsoft.public.access.forms
Robert T
external usenet poster
 
Posts: 225
Default Find Name of Subform?

Larry and Ken:

Thanks so much for taking the time to write such a detailed explanation. It
will take awhile to digest all of that info, however, it was extremely
helpful and provided new insight into Access.

Hope both of you have a great day!

Oh by the way, on a completely different note, maybe you guys can check out
my request for help in "Forms Design"? We are Trainers and we register
students for our training classes here at work in Access 2003. When a
customer sends an email registering for one of our courses, after we enter
his/her info in our database, we in turn want to click a button on the form,
and automatically send an EMAIL reply to that customer via Outlook 2003.

I've only had one reply so far and it doesn't seem to work. Maybe you guys
have a simple solution to send only one email message confirming the
student's registgration in a specific class.

Thanks,
Robert
  #7  
Old July 26th, 2006, 02:24 PM posted to microsoft.public.access.forms
Robert T
external usenet poster
 
Posts: 225
Default Find Name of Subform?

Ken and Larry:

Whoops, the send email question was asked in the FORMS CODING forum.

Robert
  #8  
Old July 26th, 2006, 02:38 PM posted to microsoft.public.access.forms
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default Find Name of Subform?

Unfortunately, I've not worked with sending emails very much. But many other
MVPs have, so perhaps one will post an answer for you.

--

Ken Snell
MS ACCESS MVP

"Robert T" wrote in message
...
Ken and Larry:

Whoops, the send email question was asked in the FORMS CODING forum.

Robert



 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.