Populate Text Box with the value from Other Text Box

2967
3
10-06-2010 10:10 AM
MarkValentino
New Contributor II
I need to populate a Text Box with the value from multiple fields on a custom edit form. The event should fire when the event OnOK fires when the page or form closes. I can populate it with a string or a date without any problem but cannot read another field on the form.

I have looked through all the help files and cannot find a sample that calls another field from a form. ESRI Tech support has no clue how to do this and it is a simple task.

Any help would be greatly appreciated.
Tags (3)
0 Kudos
3 Replies
markfarina
New Contributor
Did you figure this out??? I would like to do the same.
0 Kudos
EricHajek1
Occasional Contributor
It sounds like you're trying to do something like this:
'Assumes this is fired by the onOK event of an editform
Dim theEditForm
Set theEditForm = ThisEvent.Object 'gets a reference to the edit form.
theEditForm.Pages("pagename").controls("control_one").value = theEditForm.Fields("field_name").value
'So, for example, you could now concatenate the values of a couple of fields, and write them to a combo or edit box as you see fit.

Dim temp
temp = theEditForm.Fields("field_name_one").value & " " & theEditForm.Fields("field_name_two").value
theEditForm.Pages("pagename").controls("control_one").value = temp
'or
theEditForm.Fields("other field name").value = temp


The things in the Customizing ArcPad help that are most useful to me are the pages titled "<something> object", for instance "form object" or "page object". The examples are sort of buried, so I can understand your frustration with that, but the "object" pages have some examples of getting references to these objects and thier basic use.

Hope this helps!
0 Kudos
IvanKautter
New Contributor III
I think you pretty much defined the solution to your own problem.  If you can pass a string or a date to the TextBox then you merely need to take the values from the other controls and concatenate those values in a string variable and pass that to the TextBox of interest.
0 Kudos