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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlinks

Status
Not open for further replies.

jdwm2310

Technical User
Jul 26, 2001
396
US
Hi,

I have three subcategories underneath these categories there are at least four command buttons. I would like to create three hyperlinks (for each subcategory) that when I click it, the list of command button will appear for that particular category. Can this be done???
 
if I am understanding you corectly this is what you are trying to do

subcategory1 <Hyperlink1>
1Commandbutton1
1Commandbutton2
1Commandbutton3
1Commandbutton4

Subcategory2 <Hyperlink2>
2Commandbutton1
2Commandbutton2
2Commandbutton3
2Commandbutton4

Subcategory3 <Hyperlink3>
3Commandbutton1
3Commandbutton2
3Commandbutton3
3Commandbutton4


An easier way to do this is to have a dropdown combo box for the sub categoties

eg. ComboBox1

To make the form look nice have all the button as such

Commandbutton1
Commandbutton2
Commandbutton3
Commandbutton4

Have all the catergories buttons 1,2,3,4 stacked nice and neat on top of each other.
set all the buttons to invisible.
you can even set the hyperlinks to invisible and stack them one ontop of the other.

Ok on selection of the combo value enter the following procedure into your form.

Private Sub ComboBox1_Change()
me.1Commandbutton1.visible = False
me.1Commandbutton2.visible = False
me.1Commandbutton3.visible = False
me.1Commandbutton4.visible = false
me.Hyperlink1.visible = False
me.2Commandbutton1.visible = False
me.2Commandbutton2.visible = False
me.2Commandbutton3.visible = false
me.2Commandbutton4.visible = false
me.Hyperlink2.visible = false
me.3Commandbutton1.visible = False
me.3Commandbutton2.visible = false
me.3Commandbutton3.visible = false
me.3Commandbutton4.visible = false
me.Hyperlink3.visible = false
if me.combobox1 = &quot;subcategory1&quot; then
me.1Commandbutton1.visible = true
me.1Commandbutton2.visible = true
me.1Commandbutton3.visible = true
me.1Commandbutton4.visible = true
me.Hyperlink1.visible = true
ElseIf if me.combobox1 = &quot;subcategory2&quot; then
me.2Commandbutton1.visible = true
me.2Commandbutton2.visible = true
me.2Commandbutton3.visible = true
me.2Commandbutton4.visible = true
me.Hyperlink2.visible = true
ElseIf if me.combobox1 = &quot;subcategory3&quot; then
me.3Commandbutton1.visible = true
me.3Commandbutton2.visible = true
me.3Commandbutton3.visible = true
me.3Commandbutton4.visible = true
me.Hyperlink3.visible = true
End If
End Sub


Hope this helps, If you are wanting to turn the subcatrgories into buttons and on press have the rest of the buttons appear the above procedure should help with that as well.

good Luck

Zero Anarchy
 
j,

Are you looking for something along the lines of a Web toolbar? Eg: you click on the hyperlink, but instead of it taking you to another page, it drops a list of three or four hyperlinks to choose from.

If that's it, you can use the visible property.

If you want the first button to look and act like a hyperlink (pointing finger and all), just type a single space in the command button's hyperlink address on the property pane. Don't use quotes or it will try to find something. Just a space. I'm using '97 and it works just fine.


HTH


John

Use what you have,
Learn what you can,
Create what you need.
 
BoxHead,

that's what exactly I am trying to do however the subcategories of labels that when click on the three command button should appear. I made all my command buttons invisible. But I don't know what code I should use for the labels to display the comand buttons???
 
On the click event of the labels, use
Code:
  CommandButtonName.Visible = True
When you click on the command button to open a form or query (or whatever) you'll probably want the command button to be invisible again. You can't make a control invisible while it has the focus, so you'll have to set the focus elsewhere. eg:
Code:
  SomeOtherCommandButton.SetFocus
  CommandButtonName.Visible = False

HTH


John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top