Select to view content in your preferred language

VB Script Error when calling GUID

788
2
06-30-2010 10:46 AM
BenjaminZank
New Contributor
Hi,
I am working in ArcPad studio and I have run into a problem that is driving me insane. I have a geodatabase with two feature classes (point, polygon) the feature classes have near identical attribute tables. I have used ArcPad Studio to create a custom form for each of the feature classes. I also found a sub-routine on another post that populates an editbox on a form with a GUID. Very handy for creating a unique key in the measurement table that is related to each feature class. This routine works great when editing the polygon feature with GPS, it even works great when editing the point feature in ArcPad Windows or by manually adding a point location in ArcPad on my mobile device (Trimble GeoXT 2008). However, when I try to edit the point using GPS in ArcPad, I always seem to pull the same error:

Script Error 800A01AB
Error Description
Unavailable
[Line 15:, Column : 2]
Source Text Unavailable

Originally I had the sub-routine set to run on the form's onload event (which as I mentioned works for the polygon and the point when I am not editing with GPS), I have tried setting it to run on the onsetactive event on the page onload and on setactive event, nothing seems to work. I have even moved the editbox to the second page and set the code to run on that page's onload and onsetactive events...nothing.

Any assistance would be much appreciated.

Thanks in advance,
Benjamin Zank

P.S. Sample code below:

Option Explicit
Dim varUniqueID

Sub UniqueID

' CREATE THE VARAIBLE AND ASSIGN IT THE CREATED GUID
                ' I commented this varaible out because I delclared it global above in the option explicit...you can delete the global varaible and declare it here if you want...
                ' globally you can do other stuff with it...
varUniqueID= System.CreateGuid

' NEXT YOU HAVE TO GRAB THE FORM PAGE AND ASSIGN THE VARAIBLE TO THE TEXTBOX

Dim objRS, objSelLayer, objEFPageOneControls3, objEditForm3
Set objSelLayer = Map.SelectionLayer
Set objRS = objSelLayer.Records
objRS.Bookmark = Map.SelectionBookmark

Set objEditForm3 = application.map.layers("fc_Species_Point_Flat").forms("EDITFORM")
Set objEFPageOneControls3 = objEditForm3.Pages("PAGE2").Controls

objEFPageOneControls3("Edit2").Value = varUniqueID

End Sub
Tags (3)
0 Kudos
2 Replies
RobertMcCann
Deactivated User
I've run into the same error.  Trying to update a GUID field results the same "source text unavailable" error.

I'm using code similar to this OnOK:
ThisEvent.Object.Fields("TESTGUID").Value = Application.UserProperties("sectionGUID")

Where Application.UserProperties("sectionGUID") is a managed global variable.

From another post, it seems the ESRI GUID field can only be managed by the system, although I've still confused if it only applies to GlobalIDS or all GUID fields.  Updating these fields through SQL or ArcView is possible, but ArcPad auto populates it.

As a work around, I've created text fields in the database which do not have this error.

Can ESRI or somebody else chime in and confirm that ArcPad will not allow you to edit GUID fields?
0 Kudos
RolfBroch
Frequent Contributor
Seems that your line 15 has an addes space between fo and rms below

Set objEditForm3 = application.map.layers("fc_Species_Point_Flat").fo rms("EDITFORM")

Try
Set objEditForm3 = application.map.layers("fc_Species_Point_Flat").forms("EDITFORM")

Rolf
0 Kudos