inserting text from a combo box to a text box

  • Thread starter Thread starter Jim A
  • Start date Start date
J

Jim A

Hi - I have a forms control combo box with several different choices. I
would like what ever is selected from the combo box to be inserted with a
certain font and size into a text box on the same sheet. Can anybody offer
some help - thanks much - Jim A
 
Hi - I have a forms control combo box with several different choices.  I
would like what ever is selected from the combo box to be inserted with a
certain font and size into a text box on the same sheet.  Can anybody offer
some help - thanks much - Jim A

Hi Jim,
try this


Private Sub ComboBox1_Change()
TextBox1.Text = ComboBox1.Text
End Sub

If the font is the same for every entry you can just set that for the
text box,
if you want it to change with different choices this should do it

Private Sub ComboBox1_Change()

Select Case ComboBox1.Text
Case "a"
TextBox1.Font.Name = "Times New Roman"
TextBox1.Font.Size = 16
Case "b"
'put your font sizes here
Case "c"
'put your font sizes here
Case Else
TextBox1.Font.Name = "Arial"
TextBox1.Font.Size = 12
End Select

TextBox1.Text = ComboBox1.Text

End Sub


hth

Regards

David
 
Back
Top