Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding items to Combo Box in Access VBA 1

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
I think in normal VB, I could use AddItem() to add values to combo box. But this doesn't seem to be an option to Access 97's VBA even if I set the property for the combo box to be Value List (as opposed to row source of SQL)! How could I add numberic values to a Combo box in VB?
[sig][/sig]
 
for A2K

if the rowSourceType is a value list then all you have to do is programmatically change the row source like it's a string.

for example...as a test i just did the following mockup

1) created a new form
2) made a comboBox called Combo3 with the rowSourceType set to "Value List"
3) set the rowSource to (Single quotes!!!)
'AA';'BB'
4) made a button called Command2
5) for Command2's on click event i entered...

Private Sub Command2_Click()
Dim keep As String
keep = Me.Combo3.RowSource
Me.Combo3.RowSource = keep & ";'CC'"
End Sub

worked fine. obviously, this is just a mockup but you're a programmer & probobly got the idea long time ago. if not let me know & i'll try & help more. for other row source types i can help too.

rafe
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top