I would like to type a value into a list box and then press a command button and have that value transfer to a list box for later use. I've been playing with the onclick event of my command button and this is what I have so far:
When I click the button I get an error:
2185 - You can't reference a property or method for a control unless the control has the focus.
Can anyone clue me into what I might be doing wrong?
thanks
Code:
Option Compare Database
Private Sub Command4_Click()
List0.AddItem Text2.Text
List0.ListIndex = List0.ListCount - 1
End Sub
When I click the button I get an error:
2185 - You can't reference a property or method for a control unless the control has the focus.
Can anyone clue me into what I might be doing wrong?
thanks