Results 1 to 6 of 6

Thread: Syntax error

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2011
    Posts
    13

    Syntax error

    This is the code I am trying to use
    vb Code:
    1. Private Sub cmdTryIt_Click()
    2.  
    3.     Dim strEmpFileName As String
    4.     Dim strBackslash   As String
    5.     Dim intEmpFileNbr  As Integer
    6.     Dim strEmpName     As String
    7.     Dim intDeptNbr     As Integer
    8.     Dim strJobTitle    As String
    9.     Dim dtmHireDate    As Date
    10.     Dim sngHrlyRate    As Single
    11.    
    12.     strBackslash = IIf(Right$(App.Path, 1) = "\", "", "\")
    13.     strEmpFileName = App.Path & strBackslash & "EMPLOYEE.Dat"
    14.     intEmpFileNbr = FreeFile
    15.    
    16.     Open strEmpFileName For Append As #intEmpFileNbr
    17.    
    18.     strEmpName = ("Enter Name (Or click Cancel to stop):")
    19.      
    20.      
    21.      
    22.      Do Until strEmpName = ""
    23.      
    24.      intDeptNbr = InputBox("Enter Debt:")
    25.      strJobTitle = InputBox("Enter Job Title:")
    26.      dtmHireDate = InputBox("Enter Hire Date:")
    27.      sngHrlyRate = InputBox("Enter Hourly Rate:")
    28.      
    29.      Write #intDeptNbr, strEmpName, strJobTitle, dtmHireDate, sngHrlyRate,
    30.      
    31.      Print strEmpName; _
    32.             Tab(25); Format$(intDebtNbr, "@@@@"); _
    33.             Tab(35); strJobTitle; _
    34.             Tab(60); Format$(intDebtNbr, "mm/dd/yyyy); _
    35.             Tab(71); Format$(Format$(sngHrlyRate, "Standard"), "@@@@@@@")
    36.            
    37.         strEmpName = InputBox("Enter name (or click Cancel to stop):")
    38.     Loop
    39.     Close #impEmpFileNbr
    40.    
    41.            
    42.  
    43. End Sub


    WHenever I try to run the program error pops up, I receive a syntax error. Can anyone help me understand why I keep getting an error?
    Last edited by Hack; Mar 29th, 2012 at 12:39 PM. Reason: Added Highlight Tags

Tags for this Thread

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