Wrox Programmer Forums
|
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 March 22nd, 2005, 03:03 PM
Authorized User
 
Join Date: Dec 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default accessing fields in a subform

Hi

I'm trying to update a table but am having trouble referencing fields within a subform of a form. Is it possible to do this?



Cheers
Tony
__________________
Cheers
Tony
 
Old March 22nd, 2005, 05:21 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Yep.
 
Old March 23rd, 2005, 09:41 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

Oh come on Brian. Throw the man a bone!

subform_object_name.Form.sub_form_field_name

The key being that you have to put the ".Form" in to indicate that you want to look within the properties of the subform. You will not get Intellisense to tell you the name of the field.

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
 
Old March 23rd, 2005, 11:19 AM
Authorized User
 
Join Date: Dec 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

cheers Randall...shame on you Brian

Cheers
Tony
 
Old March 23rd, 2005, 02:06 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Well, gee Tony. I was hoping to get you to post just a little of what [u]exactly</u> you were trying to accomplish. I don’t think that I concur that this is a cause for shame on my part.

It seems to me that when you are asking for help you should be a little more forthcoming about what the situation is. I mean, that seems reasonable, don't you think? Even when my wife says to me, “Can you help me?”—leaving it at that—my response always is “I don’t know; what is it that you need?” If she asks me if I’ll do her a favor, I always wait to know what it is before I answer.

This is a way of doing things that I adopted after reading Heinlein’s [sp?] Stranger in a Strange Land, being impressed with the behavior and the whole idea of the professional witnesses in that book.
 
Old March 23rd, 2005, 11:04 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

Brian, you are a funny guy!

Of course I agree with you wholeheartedly! Give us enough of a clue so we don't spend extra time answering the wrong question.

And while we're on this tirade. I wish method (who was the first person I saw receive admonishment from Brian), would please do some of his own research. Makes me want to stop answering his questions. And then when he asks the exact same question in different threads I'm even more apt to let him go it alone. (See: http://p2p.wrox.com/topic.asp?TOPIC_ID=27987 and http://p2p.wrox.com/topic.asp?TOPIC_ID=27774)

Okay. I'm done.

Well, one more thing.... In this case I think Brian's first answer was pretty appropriate. No offense Hudson40, but ask a Yes or No question, get a Yes or No answer.

Now I'm done.

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
 
Old March 24th, 2005, 12:31 PM
Authorized User
 
Join Date: Mar 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What you want hudson40 is:

Forms!form_name.nameof_subform.Form.recordsource=s tring of criteria

do it all together instead of selecting fields

change data, edit and:

tabledef
with
edit.or add.

update.
end with

etc, etc...

Fokes aren't very helpfull setting levels in a no game zone.

 
Old March 24th, 2005, 10:20 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

Funny. I thought the question was already answered???

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
 
Old March 25th, 2005, 06:15 AM
Authorized User
 
Join Date: Mar 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You don't need VBA to access fields in a table.
You need VBA to control data to and from a table.
The prople answer is "look for the Control Source property of the control in design view".






Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing FormView fields LanceRoss ASP.NET 3.5 Basics 9 July 26th, 2008 12:32 PM
HELP! accessing a subform detail section from form tekgod Access VBA 0 July 9th, 2007 05:20 PM
Disable fields in a subform ltdavecass Access VBA 4 January 31st, 2007 09:43 PM
Controlling width of fields in a subform HowardB Access 2 April 13th, 2005 06:50 AM
check subform fields damnnono_86 Access 1 December 29th, 2003 11:36 AM





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