Solved! Go to Solution.
Option Explicit Dim g_bAlreadyOpened, XCoord, YCoord g_bAlreadyOpened = False Sub OnLoadForm If g_bAlreadyOpened = False Then XCoord = Application.GPS.X YCoord = Application.GPS.Y g_bAlreadyOpened = True End If Applet.Forms("T1").Pages("Page1").Controls("Easting").Value = XCoord Applet.Forms("T1").Pages("Page1").Controls("Northing").Value = YCoord End Sub Sub OnUnloadForm If g_bAlreadyOpened = True Then XCoord = Applet.Forms("T1").Pages("Page1").Controls("Easting").Value YCoord = Applet.Forms("T1").Pages("Page1").Controls("Northing").Value Applet.Forms("T1").Show End If End Sub Sub OnCancelForm g_bAlreadyOpened = False End Sub