473,320 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

can I reference a subform as an object?

Dim frm as Form
Set frm = Forms!frmMain!frmSub1.Form!frmSub2

Can I do this? I can't seem to get this to work...
What is correct syntax?

-- or how about --

Dim ctl as Control
Set ctl = Forms!frmMain!frmSub1.Form!frmSub2.Form!Myctl

Can I do this?

Thanks!
Nov 12 '05 #1
1 1501

On Wed, 14 Jan 2004 09:59:32 GMT, "deko" <dj****@hotmail.com> wrote:
Dim frm as Form
Set frm = Forms!frmMain!frmSub1.Form!frmSub2
You are trying to set a Form variable to a control. ...frmSub2 is a subform
control, and ...frmSub2.Form is the form in that control. The following
should fix it.

Dim frm as Form
Set frm = Forms!frmMain!frmSub1.Form!frmSub2.Form

....-- or how about --

Dim ctl as Control
Set ctl = Forms!frmMain!frmSub1.Form!frmSub2.Form!Myctl

Can I do this?


Sure, that looks right.
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rob | last post by:
THere must be an easy way to do the following, but I'm drawing a blank. I have 2 forms frmA and frmB. I double click on a text box in frmA and open frmB. In frmB, I select an item and close. ...
3
by: DFS | last post by:
I've been working around this for years (I believe), so I figured someone here might know: Why won't a crosstab query accept a value from a form reference? TRANSFORM...
3
by: tlyczko | last post by:
I have a main form with 2 subforms, each subform references different data in the same table. How do I make sure each subform only creates NEW records in the referenced table and do not...
14
by: Kurt | last post by:
I have an unbound main form with an unbound subform. frmProjects fsubProjectList Using combo boxes, the user can select several search criteria on frmProjects and then click a command button....
5
by: (PeteCresswell) | last post by:
I've got a parent form and three subforms. Two of them work A-OK. For the third one, in the Immediate window: ----------------------------------------- ?Me.subDeal.Name subDeal ...
14
by: mchlle | last post by:
How can I filter records of a subform that is part of a tab control? The filter works fine on the form when it is not part of the tab using this in the macro condition: !!="Today" I have a main...
2
by: David W. Fenton | last post by:
I think at various times we've all encountered this problem: A subform is on a main form. From the code of the main form we refer to some property of/control on the child form thus: ...
3
by: luanhoxung | last post by:
Hi all !! i have met trouble with referring textbox of subform in VBA i know i can do as: forms!mainform.subform.textbox but i want do it in shorter path. any suggestion about using variable ?...
6
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
5
by: ApexData | last post by:
My popup form can reference the MAINFORM by using either line of the code shown below: --------------------------------------------------------------------------------...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.