Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make "visible" by button or "click here"

Status
Not open for further replies.

caman74

IS-IT--Management
Jan 1, 2005
67
NO
Hi.

I wonder if there is a way to enable "Visible" view by clicking on a button or a "+" graphic symbol.
I have some windows in my forms that are set to non visible by default, and I need them to get Visible for adding new records, either by a "Add" icon or a button.

Chris
 
caman74 said:
I have some windows in my forms
What is that? Subforms? If yes
create a command button on the form name it "cmdAdd" caption = + (a plus sign)
And the code below for the button
Code:
Private Sub cmdAdd_Click()
    If Me.cmdAdd.Caption = "+" Then
        Me.SubFormName.Visible = True
        Me.cmdAdd.Caption = "-"
    Else
        Me.SubFormName.Visible = False
        Me.cmdAdd.Caption = "+"
    End If
End Sub
Change the "SubFormName" to actual name.
hope this helps


________________________________________________________________________
Zameer Abdulla
Visit Me
A sweater is usually put on a child when the parent feels chilly.
 
Thank you for a quick reply.

I'm not sure what its name is in english, but in Access Forms design view, under the meny "Toolbox" it is called (freel translated from norwegian) category control.

It is a window with several tabs on top...

I would also know if it is a way to name each tab by text entered in a textbox in each window.

Chris
 
Tab control ;-)

The following syntax, is one way that I think should make it possible to toggle the .visible property of individual tabs

[tt]me!minKategori.Pages("Side1").Visible = <False/True...>[/tt]

To toggle the names, I'm guessing you're more after the caption

[tt]me!minKategori.Pages("Side1").Caption = "bl[&aelig;]h..."[/tt]

Roy-Vidar
 
I understand you are talking about "TabControl" but I can't understand your requirement.
Do you need to identify each page by name or by index?
Can you pls write a more clear as you can...
Here is a sample to show / hide tab pages from a selection of Option group
Code:
Private Sub OptionGroupName_AfterUpdate()
Select Case OptionGroupName.Value
Case 1 'Dependants 
	Me.YourTabControlName.Pages("PageName1").Visible=False
Case 2 'Employees 
	Me.YourTabControlName.Pages("PageName2").Visible=False
Case Else 'Both
	Me.YourTabControlName.Pages("PageName1").Visible=True
	Me.YourTabControlName.Pages("PageName2").Visible=True
End Select
End Sub

________________________________________________________________________
Zameer Abdulla
Visit Me
A sweater is usually put on a child when the parent feels chilly.
 
Thanx Roy-Vidar.

ZmrAbdulla:
I'm using this TabControl on a Contact form.

The company info is places directly on the form, but each locaton/ department will be placed on the TabControl.
As new departments or locations belonging to a spesific Company needs to be applied, I want to add these by clicking on the "add dep" Icon/ button.

I would also rename the Tabname automaticly, linking it to a textbox inside the TabControl...

Chris
 
There is some confusion..
I need to know the table setup..
caman74 said:
As new departments or locations belonging to a spesific Company needs to be applied, I want to add these by clicking on the "add dep" Icon/ button.
I hope you have three tables
Master Table: Companies
Sub Table1 : Locations
Sub Table2 : Departments

so once you need to add department/location you need to AllowAdditions=True to the respective subform.

Need more details...

________________________________________________________________________
Zameer Abdulla
Visit Me
A sweater is usually put on a child when the parent feels chilly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top