=> Add values to a combo drop down list box

R

Rhonda Fischer

Hello,

I am trying to add line items to a combo
list using the following code however only
the last of the items displays in the text
field of the combo box, the drop down list
is empty.

How do I do this?

Thank you kindly for any suggestions :)
Rhonda

************************************************

Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize

'List of Values in Accident Type Combo
cboType.Value = "Driving"
cboType.Value = "Chemical"
cboType.Value = "Collision"
cboType.Value = "Fall"
 
M

Mark Phillipson

Rhonda,

If you are using Access 2002 or later then the following should work:

cboType.AddItem "Driving"
cboType.AddItem "Chemical"
cboType.AddItem "Collision"
cboType.AddItem "Fall"

If using Access 2000 or earlier then:

Me.cboType.RowSourceType = "Value List"
Me.cboType.RowSource = "Driving;Chemical;Collison;Fall"
Me.cboType.Requery

HTH


--

Cheers
Mark

Free Access/Office Add-Ins at:
http://mphillipson.users.btopenworld.com/
 

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