Select to view content in your preferred language

Setiing the value of a control on a different page but in the same edit form

811
2
12-04-2012 04:47 PM
RichardGlass
Occasional Contributor
Hi

I have two pages in a form I use to update attributes - I want to update a control on a page based on a value being changed on a different page.  I can update control values on the same page but it doesn't seem to work when trying to change the value of a control box located on another page even though I am hard coding the pathname?

This is it in it's simplest form(this doesn't work by the way). The second line works as the control is on that page the and is run when a user changes the value using the onselchange event the first line doesnt as this control is on a different page.

Can someone please shed some light??

Sub SiteID

application.map.editlayer.forms("EDITFORM").pages("General").controls("g_si_tx").value = "Test"
application.map.editlayer.forms("EDITFORM").pages("TL").controls("ob_l_tx").value = "Test1"

End Sub
Tags (3)
0 Kudos
2 Replies
GarethWalters
Deactivated User
Hi Richard,

You could change the second line to Application.UserProperties("Test1Value") = "Test1"
And then when you activate the page make the control = Application.UserProperties("Test1Value")

And if you don't want to physically go to that page you can invoke it automatically using:

application.map.editlayer.forms("EDITFORM").pages("TL").acvtivate
...
controls("ob_l_tx").value = Application.UserProperties("Test1Value")
...
application.map.editlayer.forms("EDITFORM").pages("g_si_tx").acvtivate


Let me know how you go.

Cheers,

Gareth
0 Kudos
RichardGlass
Occasional Contributor
HI - this works sets the variable globally(well I think) but how do I access this variable after I have captured a point by pressing the OK button, I am trying to retrieve the SiteID value on another form. It is initially captured on the General form and I would like to attach it to a the same field on the " true left" form without having to type the siteID in repeatedly

sub siteID


GlobalVariable = application.map.editlayer.forms("EDITFORM").pages("General").controls("g_si_tx").value
Application.MessageBox GlobalVariable
Application.UserProperties("SiteName") = GlobalVariable
End Sub
0 Kudos