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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Invisible/Hidden Combo Boxes?



 
 
Thread Tools Display Modes
  #1  
Old March 21st, 2005, 07:13 PM
BadJooJooJen
external usenet poster
 
Posts: n/a
Default Invisible/Hidden Combo Boxes?

I have a tracking form with 4 combo boxes. Combo1 and 2 are linked, the
option chosen in Combo1 drives the options displayed in Combo2. Combo3 and 4
are linked to each other in the same way. But I don't even need Combo boxes
3 and 4 unless option 3 in Combo box 1 is selected. Is it possible to hide
Combo boxes 3 and 4, until the right option is selected in Combo1? If so,
how? (please advise on necessary relationships between tables)

Thanks!
  #2  
Old March 21st, 2005, 07:29 PM
kabaka
external usenet poster
 
Posts: n/a
Default

Why not just set the visible properties of combo 3 & 4 based on the selected
value in combo 1. i.e
Private Sub Combo1_AfterUpdate()
if me.combo1.value = "condition to show" then
me.combo3.visible = true
me.combo4.visible = true
else
me.combo3.visible = false
me.combo4.visible = false
end if
end sub

if you'd rather just have 3 & 4 greyed out (but still visible) use the
enabled property instead.

Hope that helps

"BadJooJooJen" wrote:

I have a tracking form with 4 combo boxes. Combo1 and 2 are linked, the
option chosen in Combo1 drives the options displayed in Combo2. Combo3 and 4
are linked to each other in the same way. But I don't even need Combo boxes
3 and 4 unless option 3 in Combo box 1 is selected. Is it possible to hide
Combo boxes 3 and 4, until the right option is selected in Combo1? If so,
how? (please advise on necessary relationships between tables)

Thanks!

  #3  
Old March 21st, 2005, 08:21 PM
BadJooJooJen
external usenet poster
 
Posts: n/a
Default

Sounds good, but I must be doing something wrong. I put the code you gave in
the AfterUpdate event for Combo1, under the Requery that I use the make sure
the right values are showing in Combo2. I get an ambigious name detected
error. I put the name of the option in Combo1 in the "condition to show".
Is there something else I should do?

"kabaka" wrote:

Why not just set the visible properties of combo 3 & 4 based on the selected
value in combo 1. i.e
Private Sub Combo1_AfterUpdate()
if me.combo1.value = "condition to show" then
me.combo3.visible = true
me.combo4.visible = true
else
me.combo3.visible = false
me.combo4.visible = false
end if
end sub

if you'd rather just have 3 & 4 greyed out (but still visible) use the
enabled property instead.

Hope that helps

"BadJooJooJen" wrote:

I have a tracking form with 4 combo boxes. Combo1 and 2 are linked, the
option chosen in Combo1 drives the options displayed in Combo2. Combo3 and 4
are linked to each other in the same way. But I don't even need Combo boxes
3 and 4 unless option 3 in Combo box 1 is selected. Is it possible to hide
Combo boxes 3 and 4, until the right option is selected in Combo1? If so,
how? (please advise on necessary relationships between tables)

Thanks!

  #4  
Old March 21st, 2005, 08:29 PM
kabaka
external usenet poster
 
Posts: n/a
Default

Please post your code so that I can try to debug. Without it I'll only be
guessing.




"kabaka" wrote:

Why not just set the visible properties of combo 3 & 4 based on the selected
value in combo 1. i.e
Private Sub Combo1_AfterUpdate()
if me.combo1.value = "condition to show" then
me.combo3.visible = true
me.combo4.visible = true
else
me.combo3.visible = false
me.combo4.visible = false
end if
end sub

if you'd rather just have 3 & 4 greyed out (but still visible) use the
enabled property instead.

Hope that helps

"BadJooJooJen" wrote:

I have a tracking form with 4 combo boxes. Combo1 and 2 are linked, the
option chosen in Combo1 drives the options displayed in Combo2. Combo3 and 4
are linked to each other in the same way. But I don't even need Combo boxes
3 and 4 unless option 3 in Combo box 1 is selected. Is it possible to hide
Combo boxes 3 and 4, until the right option is selected in Combo1? If so,
how? (please advise on necessary relationships between tables)

Thanks!

  #5  
Old March 21st, 2005, 09:11 PM
BadJooJooJen
external usenet poster
 
Posts: n/a
Default

Private Sub ChangeMade_AfterUpdate()
Me.ChangeType = Null
Me.ChangeType.Requery
Me.ChangeType = Me.ChangeType.ItemData(0)
End Sub

Private Sub ChangeMade_AfterUpdate()
If Me.ChangeMade.Value = "Rules" Then
Me.Groups.Visible = True
Me.Names.Visible = True
Else
Me.Groups.Visible = False
Me.Names.Visible = False
End If
End Sub

Private Sub Groups_AfterUpdate()
Me.Names = Null
Me.Names.Requery
Me.Names = Me.Names.ItemData(0)
End Sub

Thanks for you help!

"kabaka" wrote:

Please post your code so that I can try to debug. Without it I'll only be
guessing.




"kabaka" wrote:

Why not just set the visible properties of combo 3 & 4 based on the selected
value in combo 1. i.e
Private Sub Combo1_AfterUpdate()
if me.combo1.value = "condition to show" then
me.combo3.visible = true
me.combo4.visible = true
else
me.combo3.visible = false
me.combo4.visible = false
end if
end sub

if you'd rather just have 3 & 4 greyed out (but still visible) use the
enabled property instead.

Hope that helps

"BadJooJooJen" wrote:

I have a tracking form with 4 combo boxes. Combo1 and 2 are linked, the
option chosen in Combo1 drives the options displayed in Combo2. Combo3 and 4
are linked to each other in the same way. But I don't even need Combo boxes
3 and 4 unless option 3 in Combo box 1 is selected. Is it possible to hide
Combo boxes 3 and 4, until the right option is selected in Combo1? If so,
how? (please advise on necessary relationships between tables)

Thanks!

  #6  
Old March 21st, 2005, 09:17 PM
kabaka
external usenet poster
 
Posts: n/a
Default

Whew... This is an easy one. As far as I know, you can't have more that one
of the same event - which is why you'd be getting an ambiguous error (meaning
you're calling one event which is in two possible and valid procedures and
Access doesn't know which one to go to). Just put the code I gave you in the
same Sub: i.e.

Private Sub ChangeMade_AfterUpdate()
Me.ChangeType = Null
Me.ChangeType.Requery
Me.ChangeType = Me.ChangeType.ItemData(0)

If Me.ChangeMade.Value = "Rules" Then
Me.Groups.Visible = True
Me.Names.Visible = True
Else
Me.Groups.Visible = False
Me.Names.Visible = False
End If
End Sub

Private Sub Groups_AfterUpdate()
Me.Names = Null
Me.Names.Requery
Me.Names = Me.Names.ItemData(0)
End Sub

Let me know if that fixes it.
  #7  
Old March 21st, 2005, 09:22 PM
Mark
external usenet poster
 
Posts: n/a
Default

You don't need the second AfterUpdate routine--that's what's causing the
ambiguous name error. Try this:

Private Sub ChangeMade_AfterUpdate()
Me.ChangeType = Null
Me.ChangeType.Requery
Me.ChangeType = Me.ChangeType.ItemData(0)
If Me.ChangeMade.Value = "Rules" Then
Me.Groups.Visible = True
Me.Names.Visible = True
Else
Me.Groups.Visible = False
Me.Names.Visible = False
End If
End Sub


  #8  
Old March 21st, 2005, 10:43 PM
BadJooJooJen
external usenet poster
 
Posts: n/a
Default

Glad it was easy. (But don't get too comfortable!) I was wondering about
the 2 AfterUpdate events for the 1 combo box. I'm still very new to Access
and I wouldn't have thought to combine the subs. I did combine them and here
is what happens.

The form opens with Groups and Names visible.
When I select any of the options, Rules included, in ChangeMade, Groups and
Names dissappear, and don't reappear.

I decided to put the hide code in the AfterUpdate event of Combo2
(ChangeType) because the options are related and tied it to the option New
Rule. Got the same result. So I reversed the False and True and the form
opened with Groups and Names hidden. When I choose Rules in ChangeMade, the
first options to appear in ChangeType is New Rule, Groups and Names stay
hidden. When I go to the next option in the list Delete Rule, they appear!
I would like the form to open with Groups and Names hidden.

Keep the ideas coming, this is a great learning experience for me!

"kabaka" wrote:

Whew... This is an easy one. As far as I know, you can't have more that one
of the same event - which is why you'd be getting an ambiguous error (meaning
you're calling one event which is in two possible and valid procedures and
Access doesn't know which one to go to). Just put the code I gave you in the
same Sub: i.e.

Private Sub ChangeMade_AfterUpdate()
Me.ChangeType = Null
Me.ChangeType.Requery
Me.ChangeType = Me.ChangeType.ItemData(0)

If Me.ChangeMade.Value = "Rules" Then
Me.Groups.Visible = True
Me.Names.Visible = True
Else
Me.Groups.Visible = False
Me.Names.Visible = False
End If
End Sub

Private Sub Groups_AfterUpdate()
Me.Names = Null
Me.Names.Requery
Me.Names = Me.Names.ItemData(0)
End Sub

Let me know if that fixes it.

  #9  
Old March 22nd, 2005, 03:45 PM
kabaka
external usenet poster
 
Posts: n/a
Default

To have the boxes be invisible when your form opens, use the OnOpen() event
of your form and put in the code

me.groups.visible = false
me.names.visible = false

that way every time it is opened they will not be seen. Start with that and
we'll go from there.

The form opens with Groups and Names visible.
When I select any of the options, Rules included, in ChangeMade, Groups and
Names dissappear, and don't reappear.

I decided to put the hide code in the AfterUpdate event of Combo2
(ChangeType) because the options are related and tied it to the option New
Rule. Got the same result. So I reversed the False and True and the form
opened with Groups and Names hidden. When I choose Rules in ChangeMade, the
first options to appear in ChangeType is New Rule, Groups and Names stay
hidden. When I go to the next option in the list Delete Rule, they appear!
I would like the form to open with Groups and Names hidden.

Keep the ideas coming, this is a great learning experience for me!

  #10  
Old March 22nd, 2005, 04:47 PM
BadJooJooJen
external usenet poster
 
Posts: n/a
Default

Done! The form now opens with Groups and Names invisible. I jumped ahead a
bit, just to see if this would work. This is the code I put in the
AfterUpdate event of the ChangeMade combo box.

Private Sub ChangeMade_AfterUpdate()
Me.ChangeType = Null
Me.ChangeType.Requery
Me.ChangeType = Me.ChangeType.ItemData(0)
If Me.ChangeMade.Value = "Rules" Then
Me.Groups.Visible = True
Me.Names.Visible = True
End If
End Sub

When I chose Rules in ChangeMade, nothing happened. But we have the first
part of what I wanted to do accomplished, so I think that is a good start.
If you are running short on time, if you can direct me to a good resource on
this issue, I may be able to get this figured out on my own. I really do
appreciate your help and persistence..

"kabaka" wrote:

To have the boxes be invisible when your form opens, use the OnOpen() event
of your form and put in the code

me.groups.visible = false
me.names.visible = false

that way every time it is opened they will not be seen. Start with that and
we'll go from there.

The form opens with Groups and Names visible.
When I select any of the options, Rules included, in ChangeMade, Groups and
Names dissappear, and don't reappear.

I decided to put the hide code in the AfterUpdate event of Combo2
(ChangeType) because the options are related and tied it to the option New
Rule. Got the same result. So I reversed the False and True and the form
opened with Groups and Names hidden. When I choose Rules in ChangeMade, the
first options to appear in ChangeType is New Rule, Groups and Names stay
hidden. When I go to the next option in the list Delete Rule, they appear!
I would like the form to open with Groups and Names hidden.

Keep the ideas coming, this is a great learning experience for me!

 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
combo question rob New Users 10 March 21st, 2005 02:05 PM
connecting combo boxes to yield data in another cell. TxN8tv General Discussion 0 March 14th, 2005 04:07 PM
VB Code help for combo boxes Cherish Running & Setting Up Queries 1 September 19th, 2004 08:38 AM
Copying Combo boxes Jamie Worksheet Functions 1 August 27th, 2004 04:15 AM
Synchronizing Multiple Combo boxes to view matching data on a Form Mark Senibaldi Using Forms 4 June 16th, 2004 08:48 PM


All times are GMT +1. The time now is 04:30 AM.


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