Compile Error - Comments appear after end sub?

james_IT

Registered User.
Local time
Today, 14:15
Joined
Jul 5, 2006
Messages
208
hi,

could someone check out the attached image and tell me where im going wrong?

when i try to open the form in form mode this error comes up?

i dont understand, its been working fine until now...

thanks
 

Attachments

what does the form timer code and the code below it look like?
 
So, you've included the entire module code in here? I don't see why it would do it from the screen shot.
 
May need to do Ye Olde /Decompile. Search ...
 
this is the form codes:


Option Compare Database

Private Sub Form_Close()
DoCmd.Hourglass False
DoCmd.OpenForm "frmMainMenu"
End Sub
Private Sub Form_Load()
DoCmd.Maximize
Dim varTime As Variant, strLegend As String
varTime = Time()

If varTime > "00:00:01" And varTime < "12:00" Then strLegend = "Welcome! Good Morning..."
If varTime >= "12:00" And varTime < "18:00" Then strLegend = "Welcome! Good Afternoon..."
If varTime >= "18:00" And varTime < "23:59" Then strLegend = "Welcome! Good Evening..."

Me.lblGreeting.Caption = strLegend
End Sub

Private Sub Form_Timer()
On Error Resume Next

DoCmd.Hourglass True
Me.TimerInterval = 0

Me.Repaint
DoEvents

ProcessTables

DoCmd.Hourglass False
DoCmd.Close acForm, "frmIntro", acSaveNo
End Sub






and this is the module linked to the form:

Option Compare Database
Option Explicit

Public fCancel As Boolean

Sub ProcessTables()
On Error GoTo Err_Handler

Dim lngCurrentPosition As Long
Dim intTable As Integer
Dim strMsg As String

DoCmd.Hourglass True
lngCurrentPosition = 0

For lngCurrentPosition = 0 To 10000
intTable = lngCurrentPosition \ 100
strMsg = "Processing table #" & intTable

UpdateProgressMeter strMsg, lngCurrentPosition

DoEvents
lngCurrentPosition = lngCurrentPosition + 1
If fCancel Then Exit For
Next

Exit_Here:
DoCmd.Hourglass False
Exit Sub

Err_Handler:
MsgBox Err.Description
fCancel = False
Resume Exit_Here

End Sub

Private Sub UpdateProgressMeter(ByVal strMsg As String, ByVal lngPosition As Long)
On Error Resume Next

Dim intPercent As Integer
Const conTotal As Integer = 10000

intPercent = (lngPosition / conTotal) * 100

With Forms!frmIntro
!lblBlue.Width = intPercent / 100 * !lblTransparent.Width
!lblMessage.Caption = "" & intPercent & "%"
.Repaint
End With

DoEvents

End Sub
 

Users who are viewing this thread

Back
Top Bottom