I've tried for about 45 minutes and can't get the ENTER key to enter a value into the test text box. I can get the PK to be entered if the space bar is used instead of the Enter key.
Code:
Private Sub List_HH_KeyPress(KeyAscii As Integer)
If KeyAscii = 32 Then '(32 = space key)
Me.Test = Me.List_HH.Value
' Me![Toa_ChiTiet Subform].Form.MSHH = Me.List_HH.Value
End If
End Sub
Double clicking on the list box seems easier.
Code:
Private Sub List_HH_DblClick(Cancel As Integer)
Me.Test = Me.List_HH.Value
' Me![Toa_ChiTiet Subform].Form.MSHH = Me.List_HH.Value
End Sub
Sorry I couldn't help more....