I have a form open (form1) and that form opens another form (form2), in form2 I want to find the tab caption on form1 but can't figure out the code. Any help is appreciated.
Thanks
Haha, don't even worry about it. We are getting it.
I think I over complicated it for you then. I was trying to get the Caption of the currently selected Tab. So, half of the code can be removed and replaced by a hard coded 3; 3 because it is a 0 based array and you want the fourth Tab. More like this then: - Forms("editmasterWAnnual").Controls("tabCtl196").Pages(3).Caption
10 2028
This is one, easy way: - forms("Formname").Caption
It wont work for subForms or Forms that aren't loaded.
Ok that gives me the caption of the form but how do I get the caption of one of the tabs on that form. I have four tabs WUMatch, WBMatch etc I want to find out the caption for one of those.
Ahh, I missed that particular. Sorry about that. This might be more like what you want: - Forms("FormName").Controls("TabCtrlName").Pages(Forms("FormName").Controls("TabCtrlName").value).Caption
ok I get an error here's the code - VMCaption = Forms(editmasterWannual).Controls(BPMatch).Pages(Forms(editmasterWannual).Value).Caption
What am I doing wrong?
I've tried it with the " around the form name with the same error.
Thanks for your help with this
If BPMatch is the Tab Control's Name and the Form Name is editmasterWannual, then I think this should do it. ...I haven't tested it - VMCaption = Forms("editmasterWannual").Controls("BPMatch").Pages(Forms("editmasterWannual").Controls("BPMatch").Value).Caption
- Forms("editmasterWannual").Controls("BPMatch").Value
should get the ordinal value of the current Tab and the rest gets the caption once we have the currently selected tab.
I still get the error 438 "Object doesn't support this property or method - VMCaption = Forms("editmasterWannual").Controls("BPMatch").Pages(Forms("editmasterWannual").Controls("bpMatch").Value).Caption
this is the code but don't know what's wrong, could I be missing a reference?
I have to run for a couple of hours will try your answer when I get back.
Thanks again
Well, that's a drag. I don't think there's a reference for this as they are in the Access Namespace, according to the Object Browser(F2). https://msdn.microsoft.com/en-us/lib...ffice.12).aspx https://msdn.microsoft.com/EN-US/lib.../ff835052.aspx
I figured it out by using the Immediate Window in the VBA Editor and MSDN Documentation, linked above. You should be able to also use the Immediate Window to find out what is going on. I would try entering some of the following lines into the Immediate Window to hopefully see where the error is occurring: - ?Forms("editmasterWannual").Name
-
?Forms("editmasterWannual").Controls.Count
-
?Forms("editmasterWannual").Controls("BPMatch").Name
-
?Forms("editmasterWannual").Controls("BPMatch").Value
-
?Forms("editmasterWannual").Controls("BPMatch").Pages.Count
I get the 438 error on the last two statements. Usually when I put in the controls and the . it gives me a drop down to select from, but when I put in the ("BPMatch") and the . I get no dropdown. Although when I entered the .name it gave me the Name BPMatch.
Ok now I feel real bad, I gave you some wrong information. Hopefully you will not cut me off from your expertise. I gave you the wrong Control name the code that works kind of is - v6 = Forms("editmasterWAnnual").Controls("tabCtl196").Pages(Forms("editmasterWannual").Controls("tabctl196").Value).Caption
In the tabctl196 there are 7 tabs I want to find what is in the tab name BPMatch The above code gives me what in the first tab. the tab name BPMatch is like the 4th one over.
Haha, don't even worry about it. We are getting it.
I think I over complicated it for you then. I was trying to get the Caption of the currently selected Tab. So, half of the code can be removed and replaced by a hard coded 3; 3 because it is a 0 based array and you want the fourth Tab. More like this then: - Forms("editmasterWAnnual").Controls("tabCtl196").Pages(3).Caption
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paul T. Rong |
last post by:
Hello,
Often when I open one form, and (without closing it) open the form in its
design view, then all the caption value of the controls in this form
remained there in form's design view that is...
|
by: Stu |
last post by:
Hi,
I have a combobox who's values change the recordsource of the form.
Within this form, there is a subform, whos records also need to change
pending the value in the combobox. I am able to get...
|
by: sc |
last post by:
From my codebehind, I am trying to get an object reference to the
current form, so I can perform a FindControl and work with one of the
child controls.
My problem is that I never know the name...
|
by: Karl Prosser |
last post by:
i have various usercontrols that get dynamically into a page
my usercontrol has html Input fields,
and from javascript i need to access them, however to access them i
need to know the form.....
|
by: MuZZy |
last post by:
Hi,
I'm trying to find a way to find out a form menu height/color as i think
it changes depending on various Windows settings.
I need to create a form of height/color of form menu so that i can...
|
by: kelvin.jones |
last post by:
Hi, if I had the ID of an input element, how can I find the input's
FORM in javascript?
Basically, given a input's dom id, I want to insert something in the
onSubmit of the Form that that input...
|
by: bg_ie |
last post by:
Hi,
I have an Access document which I've been asked to debug and update a
little. The problem is that i can't find where one of the Forms is
being called from. In other words, I can't navigate...
|
by: dkohel |
last post by:
I have a form that returns 100 items. All of the items have have a
different value in their Category field.
EXAMPLE:
----------------
A
B
C
How can I change the value of the caption in...
|
by: beacon |
last post by:
Hi everybody,
I'm using Access 2010, but the format for the database is .mdb because I'm not ready to fully convert it to Access 2010 and the .accdb format.
I've been reading up on how to...
|
by: DenverBigDad |
last post by:
I have an access database that I am developing for use each day. I am a relatively inexperienced vba user, so I am using/reusing a lot of code that I have developed for specific tasks, learning new...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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...
|
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...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |