inserting text from a combo box to a text box

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
 
D

David Heaton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top