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 / Programming / May 2008

Tip: Looking for answers? Try searching our database.

change the appearnce of a userform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TUNGANA KURMA RAJU - 26 May 2008 11:13 GMT
Is it possible design a user form with cusomised controls ?
I built a userform with multipage control.
Page 1                     Page2                  Page3
1 label                     1 label                  1 label
1 combobox              1 combobox          1 combobox
3 commandbuttons     3 commandbuttons  3 commandbuttons
10 textboxes              6textboxes               4 textboxes
is it possible redesign this userform into a compact one page form?
By putting 3 optionbuttons at top of the userform,if  optionbutton1 is
selected userform with 10 textboxes be displayed,if optionbutton2 is selected
userform appearance be changed with 6 textboxes.
Minitman - 26 May 2008 11:25 GMT
Why do you want to eliminate the MultiPage control?  Knowing your
motivation for change will help us to help you to find your solution.

-Minitman

>Is it possible design a user form with cusomised controls ?
>I built a userform with multipage control.
[quoted text clipped - 7 lines]
>selected userform with 10 textboxes be displayed,if optionbutton2 is selected
>userform appearance be changed with 6 textboxes.
Norman Jones - 26 May 2008 12:36 GMT
Hi Tungana,

Create a Userform with a Label, a ComboBox
3 CommandButtons and 3 OptionButtons.

Add 10 TextBoxes where:

TextBoxes 1 - 4 are the TextBoxes from the
Page3 option;

TextBox5 and TextBox6 are the additional 2
TextBoxes from the Page2 option;

TextBox7 - TextBox10 are the remaining 4
TextBoxes.

In the Userform's code module, paste the
following code:

'===========>>
Option Explicit

'------------->>
Private Sub OptionButton1_Click()
   Dim i As Long

   For i = 1 To 10
       Me.Controls("Textbox" & i).Visible = True
   Next i

End Sub

'------------->>
Private Sub OptionButton2_Click()
   Dim i As Long

   For i = 1 To 10
       Me.Controls("Textbox" & i).Visible = i < 7
   Next i

End Sub

'------------->>
Private Sub OptionButton3_Click()
   Dim i As Long

   For i = 1 To 10
           Me.Controls("Textbox" & i).Visible = i < 5
   Next i

End Sub

'------------->>
Private Sub UserForm_Initialize()
   Dim i As Long

   For i = 1 To 10
       Me.Controls("Textbox" & i).Visible = False
   Next i

End Sub
'<<===========

---
Regards.
Norman

> Is it possible design a user form with cusomised controls ?
> I built a userform with multipage control.
[quoted text clipped - 8 lines]
> selected
> userform appearance be changed with 6 textboxes.
 
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.