Check box code.

R

Rpettis31

I have several check boxes on a form that upon selection I would a combo box
to change its value.

Private Sub chkSort_KeyPress(KeyAscii As Integer)

If Me.chkSort = True Then _
Me.cboDMRStatus.Value = "In Process"

End Sub
 
R

Rpettis31

This check box is in a tabbed form where as the the combo box is not in the
tabbed area.
 
L

Linq Adams via AccessMonster.com

Where the checkbox or the combobox resides doesn't come into it; they're both
on the same form and are referenced as if they were. You need to move the
code out of the KeyPress event to the AfterUpdate event. You also need to
include code to "reset" the combobox in case your user realizes that he/she
made a mistake and unchecks the box. This should do the job:

Private Sub chkSort_AfterUpdate()
If Me.chkSort = True Then
Me.cboDMRStatus.Value = "In Process"
Else
Me.cboDMRStatus.Value = ""
End If
End Sub
 
Top