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

Set Value of ComboBox in VBA

P: 28
Hi all,

I have combo box where I can choose week number (but it show also start and end date(call week number)) and also have end date(called edate) combo box .

Now i want to something, when i will choose week number, end date will be show up in edate combo box.

Example: when i select "1" in week number combo box, otherbox (edate) will show 2009/01/04

is it possible?

Thank you.
Attached Images
File Type: bmp attachment1.bmp (21.9 KB, 1496 views)
File Type: jpg attachment2.jpg (9.6 KB, 671 views)
Jan 7 '09 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,186
To set the value of the ComboBox in VBA simply assign the required value to it :
Expand|Select|Wrap|Line Numbers
  1. Me.EDate = #4 Jan 2009#
As far as accessing the non-default value of a ComboBox is concerned, you can use the Column property (Don't specify Row parameter if you want to use the default (selected) row) :
Expand|Select|Wrap|Line Numbers
  1. Me.EDate = Me.[Week Number].Column(2)
NB. From your pictures, column 2 (3rd column) is not actually a date value, but a date/time value. This is likely to cause you problems unless you're careful.

PS. Please remember in future to provide a meaningful name for your question (See FAQ - Thread titles).
Jan 8 '09 #2

Post your reply

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