Combo box

  • Thread starter Thread starter EMILYTAN via AccessMonster.com
  • Start date Start date
E

EMILYTAN via AccessMonster.com

How to add item into a combo box using hard code...
 
Is your combobox's Row Source Type Table/Query or Value List?
 
If your RowSource is a Value List, the following code demonstrates how to add
a value thru VBA, where the control TextBoxValueToAdd holds the new item to
be added:

Private Sub AddValueToComboboxButton_Click()
If Not IsNull(TextBoxValueToAdd) Then
YourComboBox.RowSource = YourComboBox.RowSource & ";" & Me.
TextBoxValueToAdd
End If
End Sub
 
How to set value to list?
How if I want to add the item through this:-
Private Sub Form_Load()
cboOracle.AddItem "Yes"
cboOracle.AddItem "No"
End Sub
 

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

Back
Top