We help IT Professionals succeed at work.
Get Started

Script out of Range error

pdvsa
pdvsa asked
on
333 Views
Last Modified: 2012-05-11
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
     Else
        '/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

Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 10 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE