Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2007

Tip: Looking for answers? Try searching our database.

UserForm - Navigating fields when changing visibie property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob W - 29 Nov 2007 18:14 GMT
Greetings,

This is quite complex to explain but here goes, below is a mock up of my
user form:-

Label Title    <Value>  *Populated from result of combo box1
Combo Box 1    <Value select>
Text Box <Value = 'Todays date"> *Populated from result of combo box1
Combo Box 2 <Value select>

The form is launched and ONLY Combo Box 1 is set to visible (others on
intilisation of form have visible set to FALSE)

The user selects a value in Combo box 1 and label and text box are populated
and Combo box 1 is then set to disabled (ENABLED = FALSE).
The user can either change the Date value in the text box or press ENTER/TAB
etc.., to leave the text box ...

However the code behind Text Box_Exit  event sets Combo Box 2 to visible.
VBA knows though whilst in the Text Box there is no where else on the form
to go, no other control are visible at that point so TAB/ENTER become
invalid options as they result in no action??

Other than adding an EXTRA button to validate the text (i.e. User is saying
I have finished my edit) can I make the Combo Box 2 appear somehow?

Hope this makes sense.
Rob W
Chip Pearson - 29 Nov 2007 23:58 GMT
If I understand correctly, you could use code like the following

Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
   If KeyCode = vbKeyTab Then
       With Me.ComboBox2
           .Visible = True
           .SetFocus
           .SelLength = Len(.Text)
           .SelStart = 0
           If .ListCount > 0 Then
               .ListIndex = 0
           End If
       End With
       KeyCode = 0
   End If
End Sub

Signature

Cordially,
Chip Pearson
Microsoft MVP  - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

> Greetings,
>
[quoted text clipped - 24 lines]
> Hope this makes sense.
> Rob W
Rob W - 02 Dec 2007 12:57 GMT
Thanks very much, worked a treat.

When I get a free minute I will look up the commands Im unfamilar with.

Thanks
Rob

> If I understand correctly, you could use code like the following
>
[quoted text clipped - 43 lines]
>> Hope this makes sense.
>> Rob W

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.