A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Making tabs invisible



 
 
Thread Tools Display Modes
  #1  
Old July 22nd, 2009, 06:35 AM posted to microsoft.public.access.forms
Jim L.[_2_]
external usenet poster
 
Posts: 56
Default Making tabs invisible

I am working on a form (Form1) that has 2 tab controls (TabA, TabB).
ComboBox M has a value list of A, B or C. I have set both tab control pages
"Visible" properties to "No". If a user selects "A" in ComboBoxM, I would
like TabA to become visible. If "B" or "C" is selected, both tabs would
remain invisible.
I have looked through this site, and found that I should enter
"Me![TabA].Visible=Me![ComboBoxM]="A"" in ComboBoxM's After Update property
(without the beginning & ending quotes). However, when I try this, I get an
error message saying "Microsoft Office can't find the macro 'Me!ComboBoxM.'
Do I need to write a macro to do this, then set the After Update property to
the macro name? If so, how do I write the macro?
I don't know anything about writing code, so please keep your answers for
the simple of mind.
Thanks Much.
  #2  
Old July 22nd, 2009, 06:46 AM posted to microsoft.public.access.forms
NevilleT
external usenet poster
 
Posts: 159
Default Making tabs invisible

Hi Jim

Try this

If Me![ComboBoxM] = "A" then
Me![TabA].Visible = True
else
Me![TabA].Visible = False
End If

You get the idea. You can add the other tabs into this or another If
statement.

Neville Turbit
www.projectperfect.com.au

"Jim L." wrote:

I am working on a form (Form1) that has 2 tab controls (TabA, TabB).
ComboBox M has a value list of A, B or C. I have set both tab control pages
"Visible" properties to "No". If a user selects "A" in ComboBoxM, I would
like TabA to become visible. If "B" or "C" is selected, both tabs would
remain invisible.
I have looked through this site, and found that I should enter
"Me![TabA].Visible=Me![ComboBoxM]="A"" in ComboBoxM's After Update property
(without the beginning & ending quotes). However, when I try this, I get an
error message saying "Microsoft Office can't find the macro 'Me!ComboBoxM.'
Do I need to write a macro to do this, then set the After Update property to
the macro name? If so, how do I write the macro?
I don't know anything about writing code, so please keep your answers for
the simple of mind.
Thanks Much.

  #3  
Old July 22nd, 2009, 09:22 AM posted to microsoft.public.access.forms
Jim L.[_2_]
external usenet poster
 
Posts: 56
Default Making tabs invisible

Hi Neville,
I wrote exactly what you put into the After Update property of ComboBoxM,
but I'm still getting the error saying MS Office can't find the macro 'If
Me![TabA]="A" then Me!TabA.'
Am I supposed to enter this in some kind of a macro instead of directly in
the combo box property? If so, what do I set the macro actions to?
Thanks again.

"NevilleT" wrote:

Hi Jim

Try this

If Me![ComboBoxM] = "A" then
Me![TabA].Visible = True
else
Me![TabA].Visible = False
End If

You get the idea. You can add the other tabs into this or another If
statement.

Neville Turbit
www.projectperfect.com.au

"Jim L." wrote:

I am working on a form (Form1) that has 2 tab controls (TabA, TabB).
ComboBox M has a value list of A, B or C. I have set both tab control pages
"Visible" properties to "No". If a user selects "A" in ComboBoxM, I would
like TabA to become visible. If "B" or "C" is selected, both tabs would
remain invisible.
I have looked through this site, and found that I should enter
"Me![TabA].Visible=Me![ComboBoxM]="A"" in ComboBoxM's After Update property
(without the beginning & ending quotes). However, when I try this, I get an
error message saying "Microsoft Office can't find the macro 'Me!ComboBoxM.'
Do I need to write a macro to do this, then set the After Update property to
the macro name? If so, how do I write the macro?
I don't know anything about writing code, so please keep your answers for
the simple of mind.
Thanks Much.

  #4  
Old July 22nd, 2009, 10:09 AM posted to microsoft.public.access.forms
Jim L.[_2_]
external usenet poster
 
Posts: 56
Default Making tabs invisible

One more quick question if I may?
I have 2 text boxes ([ReportNumber1] & [ReportNumber2]) on this same form,
both with a different control source from the query (the report numbers are
related, but go into different tables). If [ComboBoxM] ="A", I would like
[ReportNumber2] to equal [ReportNumber1]. How can I write this Iif statement
so if [ComboBoxM]="B" or "C", [ReportNumber2] will remain null (something
like...=Iif(([ComboBoxA]="A"),[ReportNumber1],Null)...). I tried it this
way, and I get the same error message about not being able to find the macro.
Do I write the expression in the "Default Value" property of [ReportNumber2]
so the control source remains intact?

"NevilleT" wrote:

Hi Jim

Try this

If Me![ComboBoxM] = "A" then
Me![TabA].Visible = True
else
Me![TabA].Visible = False
End If

You get the idea. You can add the other tabs into this or another If
statement.

Neville Turbit
www.projectperfect.com.au

"Jim L." wrote:

I am working on a form (Form1) that has 2 tab controls (TabA, TabB).
ComboBox M has a value list of A, B or C. I have set both tab control pages
"Visible" properties to "No". If a user selects "A" in ComboBoxM, I would
like TabA to become visible. If "B" or "C" is selected, both tabs would
remain invisible.
I have looked through this site, and found that I should enter
"Me![TabA].Visible=Me![ComboBoxM]="A"" in ComboBoxM's After Update property
(without the beginning & ending quotes). However, when I try this, I get an
error message saying "Microsoft Office can't find the macro 'Me!ComboBoxM.'
Do I need to write a macro to do this, then set the After Update property to
the macro name? If so, how do I write the macro?
I don't know anything about writing code, so please keep your answers for
the simple of mind.
Thanks Much.

  #5  
Old July 23rd, 2009, 12:19 AM posted to microsoft.public.access.forms
NevilleT
external usenet poster
 
Posts: 159
Default Making tabs invisible

Hi Jim
I built the form as you described it and it works. I am using the following
code.

Private Sub Form_Open(Cancel As Integer)
Me.ComboBoxM = ""
End Sub

Private Sub ComboBoxM_AfterUpdate()
If Me.ComboBoxM = "A" Then
Me.TabA.Visible = True
Me.ReportNumber2 = Me.ReportNumber1
Else
Me.TabA.Visible = False
End If
End Sub

Note that I set the combobox value to blank when the form opens. If you
want a copy of the database, send me your email address to


Regards

Neville Turbit
www.projectperfect.com.au

"Jim L." wrote:

One more quick question if I may?
I have 2 text boxes ([ReportNumber1] & [ReportNumber2]) on this same form,
both with a different control source from the query (the report numbers are
related, but go into different tables). If [ComboBoxM] ="A", I would like
[ReportNumber2] to equal [ReportNumber1]. How can I write this Iif statement
so if [ComboBoxM]="B" or "C", [ReportNumber2] will remain null (something
like...=Iif(([ComboBoxA]="A"),[ReportNumber1],Null)...). I tried it this
way, and I get the same error message about not being able to find the macro.
Do I write the expression in the "Default Value" property of [ReportNumber2]
so the control source remains intact?

"NevilleT" wrote:

Hi Jim

Try this

If Me![ComboBoxM] = "A" then
Me![TabA].Visible = True
else
Me![TabA].Visible = False
End If

You get the idea. You can add the other tabs into this or another If
statement.

Neville Turbit
www.projectperfect.com.au

"Jim L." wrote:

I am working on a form (Form1) that has 2 tab controls (TabA, TabB).
ComboBox M has a value list of A, B or C. I have set both tab control pages
"Visible" properties to "No". If a user selects "A" in ComboBoxM, I would
like TabA to become visible. If "B" or "C" is selected, both tabs would
remain invisible.
I have looked through this site, and found that I should enter
"Me![TabA].Visible=Me![ComboBoxM]="A"" in ComboBoxM's After Update property
(without the beginning & ending quotes). However, when I try this, I get an
error message saying "Microsoft Office can't find the macro 'Me!ComboBoxM.'
Do I need to write a macro to do this, then set the After Update property to
the macro name? If so, how do I write the macro?
I don't know anything about writing code, so please keep your answers for
the simple of mind.
Thanks Much.

  #6  
Old July 23rd, 2009, 02:49 AM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Making tabs invisible

This

MS Office can't find the macro 'If
Me![TabA]="A" then Me!TabA.'


indicates that you've placed the code you've been given

Private Sub ComboBoxM_AfterUpdate()
If Me.ComboBoxM = "A" Then
Me.TabA.Visible = True
Me.ReportNumber2 = Me.ReportNumber1
Else
Me.TabA.Visible = False
End If
End Sub

in the Property box of the combobox in the Properties sheet, when the names
of macros are normally entered in order to be run.

The code above needs to be placed in... that's right! In the code module, not
in the property box!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200907/1

  #7  
Old July 23rd, 2009, 03:53 AM posted to microsoft.public.access.forms
Jim L.[_2_]
external usenet poster
 
Posts: 56
Default Making tabs invisible

Neville,
I looked around and noticed the code builder option in the After Update
property, so now I understand where to place the code. I entered the code
you gave me, and all aspects are working great. Now I think I may be able to
begin applying so many of these posts I have ignored, because they include
code. You've opened my reluctant eyes.
Thanks for the help

"NevilleT" wrote:

Hi Jim
I built the form as you described it and it works. I am using the following
code.

Private Sub Form_Open(Cancel As Integer)
Me.ComboBoxM = ""
End Sub

Private Sub ComboBoxM_AfterUpdate()
If Me.ComboBoxM = "A" Then
Me.TabA.Visible = True
Me.ReportNumber2 = Me.ReportNumber1
Else
Me.TabA.Visible = False
End If
End Sub

Note that I set the combobox value to blank when the form opens. If you
want a copy of the database, send me your email address to


Regards

Neville Turbit
www.projectperfect.com.au

"Jim L." wrote:

One more quick question if I may?
I have 2 text boxes ([ReportNumber1] & [ReportNumber2]) on this same form,
both with a different control source from the query (the report numbers are
related, but go into different tables). If [ComboBoxM] ="A", I would like
[ReportNumber2] to equal [ReportNumber1]. How can I write this Iif statement
so if [ComboBoxM]="B" or "C", [ReportNumber2] will remain null (something
like...=Iif(([ComboBoxA]="A"),[ReportNumber1],Null)...). I tried it this
way, and I get the same error message about not being able to find the macro.
Do I write the expression in the "Default Value" property of [ReportNumber2]
so the control source remains intact?

"NevilleT" wrote:

Hi Jim

Try this

If Me![ComboBoxM] = "A" then
Me![TabA].Visible = True
else
Me![TabA].Visible = False
End If

You get the idea. You can add the other tabs into this or another If
statement.

Neville Turbit
www.projectperfect.com.au

"Jim L." wrote:

I am working on a form (Form1) that has 2 tab controls (TabA, TabB).
ComboBox M has a value list of A, B or C. I have set both tab control pages
"Visible" properties to "No". If a user selects "A" in ComboBoxM, I would
like TabA to become visible. If "B" or "C" is selected, both tabs would
remain invisible.
I have looked through this site, and found that I should enter
"Me![TabA].Visible=Me![ComboBoxM]="A"" in ComboBoxM's After Update property
(without the beginning & ending quotes). However, when I try this, I get an
error message saying "Microsoft Office can't find the macro 'Me!ComboBoxM.'
Do I need to write a macro to do this, then set the After Update property to
the macro name? If so, how do I write the macro?
I don't know anything about writing code, so please keep your answers for
the simple of mind.
Thanks Much.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.