village_alchemist
09-02-2004, 02:04 PM
:blush Ok, this is embarrassing. I'm trying to add a function to some code and I'm getting a compile error: "Expected End Sub" with the End Function line highlighted and the execution line showing as function statement line. If I remove the function/end function statements and just set iEngHours, everything is fine.
I seem to have trashed my VBA help too (hangs on opening), but that's a separate problem...
Here is the code, any ideas?
Private Sub cmdHourQuote_Click()
Dim iEngHours As Integer
iEngHours = ProjectHours()
If iEngHours > 0 Then
MsgBox "This project will take approximately" & vbCrLf _
& Str(iEngHours) & " hours.", vbOKOnly + vbInformation, "Quick Hour Quote"
End If
End Sub
Private Function ProjectHours() As Integer
ProjectHours = 1
End Function
I seem to have trashed my VBA help too (hangs on opening), but that's a separate problem...
Here is the code, any ideas?
Private Sub cmdHourQuote_Click()
Dim iEngHours As Integer
iEngHours = ProjectHours()
If iEngHours > 0 Then
MsgBox "This project will take approximately" & vbCrLf _
& Str(iEngHours) & " hours.", vbOKOnly + vbInformation, "Quick Hour Quote"
End If
End Sub
Private Function ProjectHours() As Integer
ProjectHours = 1
End Function