Access 2007 pass Tab control subform name to vba module

I have a vba function now called from a subform on a tab control. Previously
when the call was made directly from a form this worked for the call:

WordDoc = "MyMergeB.docx"
Call GenWordDocs(Me, WordDoc)

This is at the beginning of the function:

Public Function GenWordDocs(InpForm As Form, strtemplate As String)
Dim frm As Form
Set frm = InpForm

What subform info should I use in the call instead of the 'Me'?  I've spent a few hours trying to figure it out. I have several of these calls from the subform depending upon what docx the user wants to generate.  Pls Help!
WFBwebAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mbizupCommented:
Try this:

 Forms(me.parent.name).controls(me.name).form


Instated of the Me.
0
IrogSintaCommented:
Did you still want to refer to the main form? If so, try this:
Call GenWordDocs(Parent, WordDoc)
0
WFBwebAuthor Commented:
This is the code in the vba module that uses the info:

strControl = Nz(frm(rst!ipName), "XX")

The subform info passed in InpForm that becomes frm needs to combine with rst!ipName to be uused to pick up data from the subform.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

IrogSintaCommented:
You can try:
Call GenWordDocs(Parent.NameOfSubformControl.Form, WordDoc)

Open in new window

0
WFBwebAuthor Commented:
I got a runtime error code 2415 application-defined or object-defined error.

However, I'm embarrassed to say that I found the problem and it didn't have anything to do with the  'me' being passed.
0
mbizupCommented:
Go ahead and post your solution, and accept it as the answer.
0
WFBwebAuthor Commented:
I originally set my form up with 3 tabs and the controls were directly on them. I, then, noticed flickering when some of the fields were changed. On the net I could only find two possible ways of getting rid of it.  One was to change all the labels to text boxes. I had alot of them and I didn't like the idea anyhow.

I went the other way.  It said to get rid of the controls on the tabs and put subforms on each of the tabs.  In the process the subform that called the problem module didn't have available all of the controls needed by the module and that's the reason it didn't work.

I'm still playing around with the subforms as there are other problems caused by using the subforms. For the time being. I'm returning to the flicker, hoping that my users can put up with it.
0
IrogSintaCommented:
There could be many causes for the flicker but it's hard to say without seeing your database.  If you want, you can open another question with regards to this and if possible upload a sample database that exhibits this problem.  If you do upload, just include the necessary objects and be sure that the tables don't have any private information.
0
WFBwebAuthor Commented:
I did a search on this site for 'Access 2007 flicker'.  There were many responses.  In one of them I found: "Tools>>Options>>Forms/Reports tab ... Uncheck 'Use Windows Themed Controls on Forms' - if it is checked".

I thought I'd give it a try and the flicker disappeared.  I don't even know what Windows Themed Controls are.

In 2007: Office Button>>Access Options>>Current database and uncheck.

I've spent many hours on this and all I needed to do was an uncheck....amazing.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IrogSintaCommented:
Good for you.  And in case you haven't seen this yet, this is from the Help file:

Use Windows-themed Controls on Forms
Uses your Windows theme on the controls on your forms and reports. This setting applies only when you use a Windows theme other than the standard theme.
0
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPDesigner and DeveloperCommented:
I have found that a common cause of flicking of a tab control is when you have a label(s) on a  tab page that is not attached to another control on the tab page.
0
WFBwebAuthor Commented:
The flickering is gone.  From all I've read there could well be other causes of tab page flickering.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.