ArcPad Login Form
Overview:
A common field data collection requirement is to automatically store the field worker's name in an attribute. This allows captured/edited features to be traced back to the field worker responsible for the captured/edited features. This sample applet demonstrates one approach to supporting this requirement.
The applet consists of a login form with the following behavior:
- When ArcPad starts, the user is presented with a login form
- The field user can select his/her name from the list of valid users
- If the field user refuses to login, ArcPad will exit
- The selected name is stored in an user property that can be retrieved from any script
To customize for your project:
- Replace the included Logo.jpg with your own Logo.jpg file
- Replace the included UserNames.dbf with your own UserNames.dbf file
To retrieve the selected user name in a script:
Dim selectedUser
selectedUser = Application.UserProperties("LoggedInEmployee")
For example, if your layer has an attribute called EMPLOYEE, you can use the following code in the OnLoad event of the layer's Edit Form:
Dim pForm
Set pForm = ThisEvent.Object
If (2 = pForm.Mode Or 3 = pForm.Mode) Then
pForm.Fields("EMPLOYEE").Value = Application.UserProperties("LoggedInEmployee")
End If
Set pForm = Nothing
To deploy the applet:
Copy the applet files (Login.apa, Login.vbs, Logo.jpg, UserNames.dbf) to the ArcPad applets folder and start ArcPad.
Download this sample from ArcScripts at: http://arcscripts.esri.com/details.asp?dbid=16477



News Feed (Atom)
7 Comments:
At Tuesday, July 21, 2009 8:05:00 PM,
Anonymous said…
HI,
Great idea. Was looking for something like this for some time now, the login part works. But storing the user name in a table aint working. Could you confirm the script is valid for the onload (Form Properties (ArcPAd 8)):
Dim pForm
Set pForm = ThisEvent.Object
If (2 = pForm.Mode Or 3 = pForm.Mode) Then
pForm.Fields("EMPLOYEE").Value = Application.UserProperties("LoggedInUser")
End If
Set pForm = Nothing
kind regards,
Luc
At Saturday, July 25, 2009 1:54:00 AM,
Craig Greenwald said…
I updated the ArcScripts description with this additional information that should help you:
Important note: When using the retrieved user name to write to a field value in an edit form, use one of the following techniques:
- If you are writing the value to a field that is hidden (i.e. no associated control shown in the edit form), set the Field value directly:
pForm.Fields("EMPLOYEE").Value =
Application.UserProperties("LoggedInEmployee")
- If you are writing the value to a field that is linked to a control on the form, set the control value:
pForm.Pages("PAGE1").Controls("EMPLOYEE").Value =
Application.UserProperties("LoggedInEmployee")
I also re-uploaded the Login.vbs file on ArcScripts to correctly use Application.UserProperties("LoggedInEmployee") instead of Application.UserProperties("LoggedInUser").
Hopefully this solves your issue.
At Friday, August 21, 2009 5:48:00 AM,
Stace said…
You guys really need to put a email link of some sort on the Blog page. Skype doesn't cut it.
At Monday, November 02, 2009 8:50:00 PM,
Almar said…
Great Applet. However I am not able to edit the provided UserNames.dbf or add my own values using another table. Is the dbf table of a certain software version? I am working with ArcGIS9.2.
At Monday, December 07, 2009 11:47:00 AM,
poipoi said…
You should put a search on your blog too. Because we can search the web, the news or the maps, but not your blog...
I'm looking for some information of any kind on the Form Wizard applet. It doesn't seem to work here for me (ArcPad 7.1).
The wizard goes through with no trouble, and reload the shapelayer all right, but when I try to create a new point in my layer, the form that appears is the common one, not the one created with the form wizard...
At Monday, December 07, 2009 12:03:00 PM,
Marika said…
to search the arcpad team blog, use the blogger search box int he top left hand corner of the page (i use it all the time).
the best place to ask specific questions is the arcpad discussion forum http://forums.esri.com/forums.asp?c=34
The ArcPad Login form SHOULD work with ArcPad 7.1, if your still having trouble, please upload a sample of your data and/or screenshot of your problem to the forum.
At Tuesday, January 19, 2010 10:07:00 AM,
softech said…
Interesting… I might try some of this on my blog, too. It’s quite interesting how you sometimes stop being innovative and just go for an accepted solution without actually trying to improve it… you make a couple of good points.
part time worker
Post a Comment
<< Home