combo box event procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I've got a combo box with event procedure 'on change' and there is a line
msgbox Screen.ActiveControl
ie. message box pops up every time value in combo box is changed and new
value is displayed.
The problem is when the old value is simply deleted, message box pops up but
it contains old value displayed (value before deletion not null or "" or
something).
Why is that?
alek_mil
 
The default value of an Access form control is the Value property, and in
the Change event procedure this property has not yet been updated. You'll
need to examine the Text property instead to determine the uncommitted
value. The following example might help to clarify this ..

Private Sub Combo0_Change()

MsgBox Nz(Screen.ActiveControl.Value, "Null")
MsgBox Screen.ActiveControl.Text

End Sub
 
alekm said:
Hi,
I've got a combo box with event procedure 'on change' and there is a line
msgbox Screen.ActiveControl
ie. message box pops up every time value in combo box is changed and new
value is displayed.
The problem is when the old value is simply deleted, message box pops up
but
it contains old value displayed (value before deletion not null or "" or
something).
Why is that?
alek_mil
 
Back
Top