button control: visible and jumpt too

BadScript

Registered User.
Local time
Today, 04:43
Joined
Oct 30, 2007
Messages
73
I have a button and I have an invisible field. When I press the button I would like the button to make a combo visible and jump to that same combo

On the click event I tried:

cbo_method2.Visible = True
DoCmd.GoToControl "cbo_method2"

But since the combo is not visible when the button is pressed cbo_method2 is still invisible and not recognized. Is there a way to solve this without making cbo_method2 visible in the oncurrent event?
 
When I press the button I would like the button to make a combo visible and jump to that same combo
Code:
[COLOR="Red"][B]Me.[/B][/COLOR]cbo_method2.Visible = True
    DoCmd.GoToControl "cbo_method2"
Do you have the Me. identifier included? That would be a reason it is not visible. You can also do it this way...
Code:
[COLOR="Red"][B]Me.[/B][/COLOR]cbo_method2.Visible = True
Me.cbo_method2.SetFocus
Also, a control cannot receive the focus unless it is visible.
 
Me.cbo_method2.Visible = True
Me.cbo_method2.SetFocus
Many thanks, that was what I was looking for :D
 
How do I make this part of a case?
I tried searching the forum on cases but it's hard to find something usefull.. I could really use a small explenation..
I'm trying to achieve something like this:

Case 1
Me.cbo_method3.Visible = True
Me.cbo_method3.SetFocus
Case 2
cbo_pg2 = Null
cbo_un2.Visible = False
 
Last edited:

Users who are viewing this thread

Back
Top Bottom