Hi,
Here's another problem that I came up with:
I have a combobox in a form with 2 columns. What I need is the following:
1. The combobox to be cleared on form_load (not only the text, but also the list)
2. The combobox to be populated with two fields in a different database (I'm pulling these two lists using a recordset and the data is ready to be fetched into the combobox)... I'm not sure how to populate the two different columns of the combobox and then how to refer to them?
3. On any change in the records, need to refresh the combobox..
Please let me know if any more inputs are required from me to make it simpler..
Thanks in advance........ :-)
1. To clear the combobox and the list in it, put a code like this in OnLoad event of the form:
- Me!cboYourCombo = Null
-
Me!cboYourCombo.RowSource = ""
2. This concerns me a little regarding two 'separate lists' but I hope you know how to get the query showing the list you need to have in your combo box.
If I assume you have that query created and it's name is qryMyList then put a code like this in the event you want to trigger the population of your combobox:
- Me!cboYourCombo.RowSource = "qryMyList"
To reffer to columns of your drop-down list use this code:
- Me!cboYourCombo.Column(Index)
Index is a number ranging between 0 (first column) and total number of columns in the list-1. Columns are indexed starting with zero.
If you have three columns then indexes are 0,1,2
3. In the event afterUpdate of your 'records' put a code like this: