'simple' frustrating task
Hi Im currently developing a database but I cant seem to fathom a seemingly simple problem.
I have a form on the form is a combo box I want it so that when you select an item from this box and then click a button the selection is then added into a text box to create a list. However I keep getting a focus error - "Run-time error '2185' You can't reference a property or method for a control unless the control has the focus.
The code Im using looks like this -
Text36.Text = DropDownList1.Text and is attached to the buttons on click event.
Re: 'simple' frustrating task
On what line do you get the error?
Re: 'simple' frustrating task
I get the error on the line I posted
Text36.Text = DropDownList1.Text
text 36 is the text box and drop down list 1 is the combo box.
the whole block looks like this
Private Sub BtnSubmit_Click()
Text36.Text = DropDownList1.Text
End Sub
Re: 'simple' frustrating task
Re: 'simple' frustrating task
when i go into the about it just says Microsoft Visual Basic 6.3
there is some other information including VBA: Retail 6.3.8863 along with a version number and other additional information.
Re: 'simple' frustrating task
Ah I have it working now by using getfocus, however each time theres a new selection it deletes the old one - which I dont want it to do.
The code now looks like this:
Code:
Private Sub Command38_Click()
DropDownList1.SetFocus
sTemp = DropDownList1.Text
Text36.SetFocus
Text36.Text = sTemp
End Sub
I was thinking an array might solve my problem ?