Login | |
|
 |
Re: VBScript runtime error: overflow - 9/17/2004 11:52:13 AM
|
|
 |
|
| |
mbouchard
Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
|
What is line 1 in your code?
|
|
| |
|
|
|
 |
Re: VBScript runtime error: overflow - 9/20/2004 6:41:10 AM
|
|
 |
|
| |
sslatimer
Posts: 4
Score: 0
Joined: 9/17/2004
From: USA
Status: offline
|
The application uses a combination of forms and VBScript. The entire .vbs file is below. Sorry for dumping so much code. I can post the XML if that helps. Thanks. Option Explicit 'Global variable (I hope) Dim theID Private Sub JumpToPage Dim objThePage Dim objTheComboBox Dim FixDate Dim FixTime Dim FixID 'Dim objTheLayer Dim objRS, objLayer Set objThePage = Application.Map.Layers("Community_Focal_Points").Forms.Item("EditForm") Set objTheComboBox = objThePage.Pages("Page1").Controls("cboTable") 'create the unique id to be used in shapefile and DBFs FixID = (objTheComboBox.ListIndex + 1) FixDate = Replace(DATE,"/","") FixTime = FormatDateTime(Time,vbShortTime) FixTime = Replace(FixTime,":","") theID = FixID & FixDate & FixTime msgbox theID 'trying to write theID value into the FACILITYID field of the shapefile 'Trying to access a field that is not bound to any controls on the form 'Get a reference to the layer Set objLayer = Application.Map.Layers("Community_Focal_Points") 'Get a reference to the layer's recordset Set objRS = objLayer.Records 'write theID into FACILITYID objRS.Fields("FACILITYID").Value = theID 'objRS.MoveLast 'objRS.MoveNext objRS.Update msgbox objRS.Fields("FACILITYID").Value & " Fac ID" 'if no choice made, notify If objTheComboBox.ListIndex = -1 Then msgbox "Please Choose Entity!" End If 'determine Page to jump to based on entity chosen If objTheComboBox.ListIndex = 0 Then objThePage.Pages("PAGE2").Activate End If If objTheComboBox.ListIndex = 1 Then objThePage.Pages("PAGE3").Activate End If If objTheComboBox.ListIndex = 2 Then objThePage.Pages("PAGE4").Activate End If If objTheComboBox.ListIndex = 3 Then objThePage.Pages("PAGE5").Activate End If If objTheComboBox.ListIndex = 4 Then objThePage.Pages("PAGE6").Activate End If If objTheComboBox.ListIndex = 5 Then objThePage.Pages("PAGE7").Activate End If If objTheComboBox.ListIndex = 6 Then objThePage.Pages("PAGE10").Activate End If If objTheComboBox.ListIndex = 7 Then objThePage.Pages("PAGE8").Activate End If If objTheComboBox.ListIndex = 8 Then objThePage.Pages("PAGE10").Activate End If If objTheComboBox.ListIndex = 9 Then objThePage.Pages("PAGE10").Activate End If If objTheComboBox.ListIndex = 10 Then objThePage.Pages("PAGE9").Activate End If If objTheComboBox.ListIndex = 11 Then objThePage.Pages("PAGE10").Activate End If If objTheComboBox.ListIndex = 12 Then objThePage.Pages("PAGE10").Activate End If If objTheComboBox.ListIndex = 13 Then objThePage.Pages("PAGE10").Activate End If End Sub Private Sub WriteToSchoolDBF Dim objThePage Set objThePage = Application.Map.Layers("Community_Focal_Points").Forms.Item("EditForm") Dim myRS Set myRS = Application.CreateAppObject("recordset") myRS.Open ("C:\Latimer\Community_pts\levels.dbf"),2 'mode of 2 allows for read/write capability 'myRS.Open ("etdm\levels.dbf"),2 'mode of 2 allows for read/write capability; iPAQ file access If Not myRS.recordcount=0 Then myRS.MoveLast 'moves to last record End If 'the code to check if the check box has been clicked or not If objThePage.Pages("Page2").Controls("chkType1").Value = True Then myRS.AddNew 'adds a new record 'myRS.Fields("SCHOOL_ID").Value = Replace(DATE,"/","")& replace(FormatDateTime(Time,vbShortTime),":","") myRS.Fields("SCHOOL_ID").Value = theID myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType1").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page2").Controls("chkType2").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("SCHOOL_ID").Value = theID myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType2").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page2").Controls("chkType3").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("SCHOOL_ID").Value = theID myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType3").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page2").Controls("chkType4").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("SCHOOL_ID").Value = theID myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType4").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page2").Controls("chkType5").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("SCHOOL_ID").Value = theID myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType5").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page2").Controls("chkType6").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("SCHOOL_ID").Value = theID myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType6").Text myRS.Update 'saves information to the recordset End If myRS.Close 'msgbox "Please tap OK to continue" End Sub Private Sub WriteToModeDBF Dim objThePage Set objThePage = Application.Map.Layers("Community_Focal_Points").Forms.Item("EditForm") Dim myRS Set myRS = Application.CreateAppObject("recordset") 'msgbox "recordset created" myRS.Open ("C:\Latimer\Community_pts\modes2.dbf"),2 'mode of 2 allows for read/write capability 'myRS.Open ("etdm\modes2.dbf"),2 'mode of 2 allows for read/write capability ; iPAQ version If Not myRS.recordcount=0 Then myRS.MoveLast 'moves to last record End If 'the code to check if the check box has been clicked or not If objThePage.Pages("Page6").Controls("chkMode1").Value = True Then myRS.AddNew 'adds a new record 'myRS.Fields("ID").Value = Replace(DATE,"/","")& replace(FormatDateTime(Time,vbShortTime),":","") myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode1").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode2").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode2").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode3").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode3").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode4").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode4").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode5").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode5").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode6").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode6").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode7").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode7").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode8").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode8").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode9").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode9").Text myRS.Update 'saves information to the recordset End If If objThePage.Pages("Page6").Controls("chkMode10").Value = True Then myRS.AddNew 'adds a new record myRS.Fields("ID").Value = theID myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode10").Text myRS.Update 'saves information to the recordset End If myRS.Close End Sub
|
|
| |
|
|
|
|
|