By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,484 Members | 1,851 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,484 IT Pros & Developers. It's quick & easy.

Dynamic generation on Combobox values

P: 2
I am trying to have the last 12 months to always be the option in the dropdown for a combo box. (Basically a combobox, with dynamic options)

I am using Access 2000.

What is the function and syntax in visual basic to edit a combobox? I can do all the dynamic month generation, but I do not know how to edit a combobox from VB.

Thank you.
Feb 7 '07 #1
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,315
If you're talking about the list for a combo box then it's Me.ComboBoxName.RecordSource
Feb 7 '07 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
I am trying to have the last 12 months to always be the option in the dropdown for a combo box. (Basically a combobox, with dynamic options)

I am using Access 2000.

What is the function and syntax in visual basic to edit a combobox? I can do all the dynamic month generation, but I do not know how to edit a combobox from VB.

Thank you.
The code is ...

Expand|Select|Wrap|Line Numbers
  1. Me.ComboBoxName.RowSourceType = "Table/Query"
  2. Me.ComboBoxName.RowSource = "SELECT ...."
  3. Me.ComboBoxName.Requery
Or

Expand|Select|Wrap|Line Numbers
  1. Me.ComboBoxName.RowSourceType = "Value List"
  2. Me.ComboBoxName.RowSource = value1;value2;...etc.
  3. Me.ComboBoxName.Requery
Triggering this code could be done on the Form Load event if no action on the form is going to affect it. If it's on the form load event you won't need the requery.

Mary
Feb 8 '07 #3

P: 2
Thats it thanks.
Feb 8 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.