Results 1 to 4 of 4

Thread: Please Help Me!

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Seattle, WA, USA
    Posts
    46

    Post

    Why won't this code work? It will send the letter to the text file but not the the number?? Please help me. This is killing me!!!

    Code:



    Private Sub Form_KeyDown(keycode As Integer, Shift As Integer)

    If keycode = 90 Then
    Dim zFile As Integer
    zFile = FreeFile
    Open "C:\Log.txt" For Append As zFile
    Print #zFile, "z";
    Close zFile
    End If
    End If
    If keycode = 48 Then
    Dim aaFile As Integer
    aaFile = FreeFile
    Open "C:\Log.txt" For Append As aaFile
    Print #aaFile, "0";
    Close aaFile
    End If
    End Sub


    Thanks,


    Kevin

  2. #2
    New Member
    Join Date
    Jun 1999
    Location
    Quebec, Quebec, Canada
    Posts
    6

    Post

    You had an extra end if

    Code:
    Private Sub Form_KeyDown(keycode As Integer, Shift As Integer)
        If keycode = 90 Then
            Dim zFile As Integer
            zFile = FreeFile
            Open "C:\Log.txt" For Append As zFile
                Print #zFile, "z";
            Close zFile
        End If
        If keycode = 48 Then
            Dim aaFile As Integer
            aaFile = FreeFile
            Open "C:\Log.txt" For Append As aaFile
                Print #aaFile, "0";
            Close aaFile
        End If
    End Sub

  3. #3
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    How did you get it so that your post was color coded like VB syntax highlighting?

  4. #4
    New Member
    Join Date
    Jun 1999
    Location
    Quebec, Quebec, Canada
    Posts
    6

    Post

    By using UBB Code. You can get a list of those code at http://www.vb-world.net/forums/ubbcode.html.

    Dynamo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width