Thread: RUN-TIME ERROR
View Single Post
  #1 (permalink)  
Old May 20th, 2004, 01:45 AM
compcad compcad is offline
Registered User
 
Join Date: May 2004
Location: HILLSBORO, OREGON, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default RUN-TIME ERROR

I have sent out many postings in the last couple of weeks. I have found the answers to those questions and now need help on this posting rather than the others. This posting may sound like one of my last postings but it is different in many ways. I also want to thank all those that have tried to help in my last postings.

THANK YOU

My question deals with another RUN-TIME ERROR.
I have created a program that works fine when arguments are being passed to the .VBP when the argument is null or empty the .VBP will send out a message that tells the user to see the adminastrator. All these arguments are passing fine, but when I take the .VBP and try to compile the project it will run fine when passed arguments and I will then recieve a RUN-TIME ERROR '9' SUBSCRIPT OUT OF RANGE message when you click on the .EXE file. Is what I want the program to do when the .EXE is pressed is show a message as such [THIS IS NOT A STANDALONE PROGRAM.]

here is the code I am using if you need more help I will get it to you.

THANK YOU

Code:
Private Sub Form_Activate()

Dim strValuesFromCommandLine() As String
Dim CmdLine As String
Dim RAFFLEID As String
Dim PASSWORD As String
Dim FirstTicketNo As String
Dim LastTicketNo As String
Dim RAFFLEID1a As String

    Form1.WindowState = 0

 strValuesFromCommandLine() = Split(Command$, ", ")
 CmdLine = strValuesFromCommandLine(0)
 RAFFLEID = strValuesFromCommandLine(1)
 PASSWORD = strValuesFromCommandLine(2)
 FirstTicketNo = strValuesFromCommandLine(3)
 LastTicketNo = strValuesFromCommandLine(4)



If PASSWORD = "1TheSecretPassword" Then
    'Enter RaffielD.
    If RAFFLEID > " " Then
        DataPath = Mid(App.Path, 1, 29) & "rmdesktop\whdata.mdb"
        DataPath1a = Right(DataPath, 11)
        Data1.DatabaseName = DataPath
        Data1.Connect = ";PWD=TheSecretPassword"
        RAFFLEID1a = RAFFLEID
        number1 = "select RaffleId, Prize1, NumberofTicketsAvailable,
shortdescription, longdescription, raffleenddate, Ticketcost, " & _
        "Timeplace, CharityName from raffles Inner Join charity on
Raffles.CharityId = charity.CharityId Where RaffleID like '" & RAFFLEID1a
& "*'"
        Data1.RecordSource = number1
        Data1.Refresh
        Data1.Recordset.FindFirst "RaffleID = '" & RAFFLEID1a & "'"
        Frame3.Visible = False
        Frame1.Visible = True
        Form1.Height = 4920
        If Data1.Recordset.NoMatch Then
            Form1.Height = 2055
            Frame3.Visible = True
            Label4.Visible = True
            Label4.Caption = "There was no RaffleID matching the data in
the Database."
        End If
    ElseIf RAFFLEID = " " Then
        Frame3.Visible = True
        Label4.Visible = True
        Label4.Caption = "No RaffleID was entered."
    End If
ElseIf PASSWORD <> " TheSecretPassword" Then
    Label4.Visible = True
    Label4.Caption = "Enter the correct PASSWORD or see the administrator."
End If

If Option2 = False Then
    txtValue.Enabled = False
    Text2.Enabled = False
    cmdPrint_Singles.Enabled = False
End If

If Option1 = False Then
    cmdPrint_All.Enabled = False
End If

End Sub
Reply With Quote