Appending a field value into another field

rlowden

rlowden
Local time
Today, 11:23
Joined
Aug 28, 2008
Messages
13
This seems to me like it should be an easy thing to do, but I can't figure out how to do it.

I want to set up an Event Procedure, so that when I double-click in a field, the value in that field gets appended to another field on the same form, separated by a semicolon (they are both text fields)

The first field I call ProjectReceivingPartner
The second field I call ProjectPartners

It have tried placing the following in the Dbl_Click Event Procedure (which would seem to me the logical way to do this):

ProjectPartners.Text=ProjectPartners.Text+ProjectReceivingPartner.Text+ ";"

But I get an error message about not being able to reference a control that does not have focus. I am absolutely new to this, have little idea what that error means, and no idea how to accomplish what seems to me to be a simple task. All help appreciated

Bob
 
You can't use the .Text property unless the control has focus. Use the .Value property instead (and since it's the default, you don't have to specify it):

ProjectPartners = ProjectPartners & ProjectReceivingPartner.Text & ";"
 
DEar Paul,

Many thanks for your reply. YOur solution works like a charm, which leads me to another question.

I used to program back in my dark ages, so the logic of the task is not my problem. My problem is that I can't seem to figure out how to reference things properly in VB, i.e. the syntax. How would I know about text extensions requiring focus, for example? So, is there any online tutorial/resource that would help me learn the syntax, specifically the proper way to reference objects and controls?

Thanks for your assistance.
Bob
 

Users who are viewing this thread

Back
Top Bottom