Run Time error 2185 (1 Viewer)

Yecats131

Registered User.
Local time
Today, 11:06
Joined
Apr 22, 2008
Messages
63
Hello,

I'm trying to code a button so that when it is clicked it creates a summary of the data that was entered. The following is my code so far:


Private Sub GenerateSummary_Click()
Dim tempsummary As String

tempsummary = "Requisition generated at the request of" & Director.Text & "via " & Manager.Text & ". ***Position Title:" & Job_Title.Text & "Internal Title:" & VTitle.Text & "."



End Sub

-----------------------------------------

I keep getting the following error:

Run-Time error '2185'

You can't reference a property or method for a control unless the control has focus.

My question is:

1. What exactly does this mean?
2. What is the easiest way to fix it?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 11:06
Joined
Aug 30, 2003
Messages
36,125
Referencing the .Text property of a control requires it to have focus. Simply drop that and it should work (the default is .Value).
 

Yecats131

Registered User.
Local time
Today, 11:06
Joined
Apr 22, 2008
Messages
63
Oh! Yup that worked.

Thanks a ton :)
 

Users who are viewing this thread

Top Bottom