Connecting Tech Pros Worldwide Help | Site Map

Set Value of ComboBox in VBA

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 7th, 2009, 08:45 PM
Newbie
 
Join Date: Nov 2008
Posts: 24
Default Set Value of ComboBox in VBA

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 Thumbnails
attachment1.bmp   attachment2.jpg  
Reply
  #2  
Old January 8th, 2009, 01:36 PM
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Age: 48
Posts: 14,330
Default

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).
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.