Marquee with Public & private ending

mba_110

Registered User.
Local time
Today, 13:58
Joined
Jan 20, 2015
Messages
280
Can anyone help here i am facing problem with marquee, i think i am missing the ending code for Private and public function.

compile error
error is "Only comments may appear end sub, end function or end property"

run-time error '94"
"Invalid use of null"


Code:
Option Compare Database

Private Sub Command28_Click()
DoCmd.OpenForm "frmemployees_Nav"

End Sub

Private Sub Command35_Click()
DoCmd.OpenForm "frmContracts_Nav"

End Sub

Private Sub Command36_Click()
DoCmd.OpenForm "frmPayroll_nav"
End Sub

Private Sub Command37_Click()
DoCmd.OpenForm "frmInsurance_Nav"
End Sub


Private Sub Command42_Click()
DoCmd.OpenForm "frmPayments_Nav"

End Sub

Private Sub Command51_Click()
DoCmd.OpenForm "frmreportcenter_Nav"
End Sub

Private Sub Form_Load()
Me.Text59 = Environ("Username")
End Sub
       


Private message As String



Public Sub Form_Open(Cancel As Integer)
message = "ABCDEFG"
End Sub

Private Sub form_timer()
txtMarquee = message
'get the first letter
Dim firstcharacter As String
firstcharacter = Left(txtMarquee, 1)

'remove first character
message = Mid$(message, 2, Len(message) - 1)
'put first character at the end of the message
message = message + firstcharacter

End Sub
 
Global declarations need to be a the top. Try moving

Code:
Private message As String

just after

Code:
Option Compare Database

As a aside I suggest you use Option Explicit. You can have Access add it to new modules by checking Require Variable Declaration

In the VB Editor, Tools, Options, Editor tab, check Require Variable Declaration.
 

Users who are viewing this thread

Back
Top Bottom