Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing the value in combo box via VBA code

Status
Not open for further replies.

hengsin

Technical User
Mar 26, 2003
128
MY
I have 4 Action status which is a combo box in a form:
New, Open, In Progress, Closed

I have also another field is use to calculate the number of working day.
Number of working day = end date - start date

When the user opens the form, the default Action Status is set to New.

After one day, i want the Action Status is change from New to Open automatically provided the Action Status is still in "New" status. Nothing will happen if the Action Status is set to "Open", "In Progress" and "Closed"

Is it possible doing this using VBA?

Thanks
 
One approach would be to change the value of the ListIndex property by first setting the focus to the combo box, and then by conditionally changing the .ListIndex property to the desired value.

Combo.SetFocus
If Combo.ListIndex = 0 Then
Combo.ListIndex = 2
End If


Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
CajunCenturion:

Where should i put the code? On the AfterUpdate event?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top