how do i get a combobox set to a specific value based upon the text entered in a text box

M

mpjm

i am trying to get a form to autoupdate whenever an employee leaves the
company. when the employee leaves, the "enddate" box is filled in with
their last day and a combo box is to be filled in saying "no" for
currently employed.

i am wondering how to get the combobox to automatically go to "no" when
the enddate is filled in and "yes" when the enddate is empty

any and all ideas/solutions/suggestions appreciated

thanks
 
S

SA

Sub YourTextControl_AfterUpdate( )
If IsNull(Me!YourTextControl) or Len(ME!YourTextControl)<1 Then
Me!YourComboControlName = "No"
Else
Me!YourComboControlName = "Yes"
End If
End Sub
 
M

mpjm

thank you! that worked perfectly.

Sub YourTextControl_AfterUpdate( )
If IsNull(Me!YourTextControl) or Len(ME!YourTextControl)<1 Then
Me!YourComboControlName = "No"
Else
Me!YourComboControlName = "Yes"
End If
End Sub
--
Of course have the combo control default to "no" for new records
---

SA
ACG Soft
http://www.groupacg.com
 
Top