Select to view content in your preferred language

Getting control of the TableForm element through VB

2399
3
Jump to solution
06-27-2012 01:49 PM
CamKenny
Emerging Contributor
I have a related table in an axf which has created a tableform.

I want to programmatically get access to the controls on the page for the tableform.

Here is the code for the editform I use:

Set pApplicantsDataForm = Application.Map.Layers("Applicants_2011").Forms("EDITFORM")
Set pApplicantsDataControls = pApplicantsDataForm.Pages("page1").Controls


So how would one get reference to the tableform using the above methodology - can it be done?
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
HannahFerrier
Deactivated User
Hi Cam,

You will need to use the 'This.Event' object to access your Related Table Forms

It is not able to be accessed using the method you have described 😞

Thanks,

Hannah

View solution in original post

0 Kudos
3 Replies
HannahFerrier
Deactivated User
Hi Cam,

You will need to use the 'This.Event' object to access your Related Table Forms

It is not able to be accessed using the method you have described 😞

Thanks,

Hannah
0 Kudos
BrianRandall
New Contributor
Does anyone know how to do this exactly?  Where do you place the thisevent.object code and how to do you write it?  I'm trying to show/hide a combo box on a tableform dependent on the values selected in another combo box on the same form.  The following code worked for an Editform but I can't mimic on the tableform.

Sub Test

Dim domSPRT_NUM
Set domSPRT_NUM = layer.forms("EDITFORM").pages("mntPage").controls("domSPRT_NUM")

Dim domCONDITION
Set domCONDITION = layer.forms("EDITFORM").pages("mntPage").controls("domCONDITION")

If domCONDITION.value = "Good" then
domSPRT_NUM.visible = false
End if'End Sub
0 Kudos
HannahFerrier
Deactivated User
My apologies for not being more descriptive 😞

Let me try to demonstrate:

The ThisEvent object represents an ArcPad event that is occurring at a particular time and supplies a series of standard properties such as object, name and result.

For example: a person is an object. It has properties such as NAME, AGE and GENDER. It also has events such as TALK, RUN and SIT.  However, using  ThisEvent.object exposes that the RUN event has properties: DIRECTION and SPEED. So every time the person runs we can tell how fast they are going.

An ArcPad example could be to check if the textboxName has a value entered using it's onValidate event -

If textBoxName = ""
then               
ThisEvent.Result = False               
ThisEvent.MessageText  = �??Please enter a Name�?�
End If

As you can see, instead of writing "layer.forms("EDITFORM").pages("PAGEONE").controls("textBoxName")", I have used ThisEvent to refer to the control. This also allows for the re-use of scripts as ThisEvent is generic and can be used to refer to any control, simply copy your script to run on different control events.

Hope this is more helpful,

Hannah 🙂
0 Kudos