troubleshooting Question

Script out of Range error

Avatar of pdvsa
pdvsaFlag for United States of America asked on
Microsoft Access
10 Comments1 Solution335 ViewsLast Modified:
Experts, I keep getting this "Script out of Range" error in the below load Event.   It seems to be something with the extra quote at the very end ((Me.OpenArgs, ";")(4) & "").  I delete this extra quote at the end but Access puts it back.  Maybe there is a syntax elsewhere.  Pay attn to the part after the LCNo in the Me.Filter part (because I added what is after it ;).  

Do you see an issue with the Me.Filter part?  I think it is in this section.  
Private Sub Form_Load()

    If Nz(Me.OpenArgs, "") <> "" Then
    If Not Me.NewRecord Then
    Me.Filter = "[letterofcreditID_Auto] = " & Split(Me.OpenArgs, ";")(0) & " AND [EndUserID] = " & Split(Me.OpenArgs, ";")(1) & " AND [LCNo] = " & Chr(34) & Split(Me.OpenArgs, ";")(2) & Chr(34) & " AND [PROJID] = " & Split(Me.OpenArgs, ";")(3) & " AND [Amount] = " & Split(Me.OpenArgs, ";")(4) & ""
       Me.FilterOn = True
        '/this is a new record
        MsgBox Split(Me.OpenArgs, ";")(4)

        Me.LetterOfCreditID_Auto = Split(Me.OpenArgs, ";")(0)
        Me.EndUserID = Split(Me.OpenArgs, ";")(1)
        Me.LCNo = Split(Me.OpenArgs, ";")(2)
        Me.ProjID = Split(Me.OpenArgs, ";")(3)
        Me.Amount = Split(Me.OpenArgs, ";")(4)
     End If
End If

End Sub

Open in new window

Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros