How to use a combobox in ms Access to display the value of field in table and at the same time present the users with a list of options to edit?

I have an unbound form where my controls (among which there are some comboxes) are filled with data in a DAO.Recordset rst (opened with a SELECT SQL statement):

me.Controls("mycontrol").Value = rst.Fields("somefield")

The combobox displays the correct value ('YES' or 'NO') stored in the table. How can I make the combobox display these two options to the user if he wants to change the value? And how to I get the value the user picked (in VBA)?

Upvotes: 0

Views: 34

Answers (1)

Never mind. I think I did it!

mycontrol.RowSourceType = "Value List"
mycontrol.RowSource = "YES;NO"

Upvotes: 0

Related Questions