|
-
Aug 5th, 2005, 09:15 AM
#1
Thread Starter
New Member
'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.
-
Aug 5th, 2005, 09:18 AM
#2
Re: 'simple' frustrating task
On what line do you get the error?
-
Aug 5th, 2005, 09:30 AM
#3
Thread Starter
New Member
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
Last edited by midgetron; Aug 5th, 2005 at 09:33 AM.
Reason: adding more code
-
Aug 5th, 2005, 09:33 AM
#4
Re: 'simple' frustrating task
-
Aug 5th, 2005, 09:37 AM
#5
Thread Starter
New Member
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.
-
Aug 5th, 2005, 11:22 AM
#6
Thread Starter
New Member
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 ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|