|
-
Jun 21st, 2006, 02:27 PM
#1
Thread Starter
Lively Member
[Resolved] Referencing subforms
I have a form called test that contains a subform called header.
The following is one correct way to reference the form name:
VB Code:
Forms!test!Header(FieldName) = CombinedDate
However, I want to reference the form via a variable or direct string as shown below. But neither of these code snippets do NOT work.
VB Code:
Forms("test.header")(FieldName) = CombinedDate
or
VB Code:
dim theName str as string
theName="test.header"
Forms(theName)(FieldName) = CombinedDate
Any ideas on how I might do it or am I missing something?
Last edited by whiteWay; Jun 22nd, 2006 at 06:49 AM.
Reason: resolved
-
Jun 21st, 2006, 03:28 PM
#2
Member
Re: Referencing subforms
I'm not sure, but I think a subform is considered a control on the main form, so maybe you could try something like this:
Code:
Forms("test").Controls("header").Controls("fieldName") = CombinedDate
then you could replace the hard coded strings with variables if this works. I'll check on it when I get back in to work tomorrow if it isn't already resolved by then.
-Ranthalion
-
Jun 22nd, 2006, 06:47 AM
#3
Thread Starter
Lively Member
Re: Referencing subforms
Thanks, you are correct. I ommitted using controls to gain access to that object.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|