F
Frank Situmorang
Hello.
Chruchdatabase that I am developing is made in many languages, so for the
welcoming greetings also should be made in languages.
It works when I derictly have the string in the VBA, but now it is not
scrolling although it shows in the intended language, what did I miss here,
here is my revised VBA:
Private Sub Form_Timer()
Static strMsg As String
Static intLet As Integer
Static intLen As Integer
Dim strTmp As String
Dim strGreeting As String
Dim t As Double
Const strLen = 30
t = Time()
Select Case t
'From 00.01(night) am to 10:59 a.m
Case Is < 0.458
' Note: This is message string #1.
strMsg = DLookup("MessageString", "[Lookup Message String_Qry]",
"[FormName] = '" & Me.Name & "' AND [StringNumber] = 1")
strGreeting = [strMsg]
'from 11 am to 2:59 pm
Case 0.458 To 0.6236
' Note: This is message string #2.
strMsg = DLookup("MessageString", "[Lookup Message String_Qry]",
"[FormName] = '" & Me.Name & "' AND [StringNumber] = 2")
strGreeting = [strMsg]
'from 3 pm to 6 p.m
Case 0.6237 To 0.75
' Note: This is message string #3.
strMsg = DLookup("MessageString", "[Lookup Message String_Qry]",
"[FormName] = '" & Me.Name & "' AND [StringNumber] = 3")
strGreeting = [strMsg]
'from 6:01 pm to Midnight
Case Is > 0.75
' Note: This is message string #4.
strMsg = DLookup("MessageString", "[Lookup Message String_Qry]",
"[FormName] = '" & Me.Name & "' AND [StringNumber] = 4")
strGreeting = [strMsg]
Case Else
MsgBox "Fix your computer's clock"
Exit Sub
End Select
If Len(strMsg) = 0 Then
strMsg = Space(strLen) & strGreeting
intLen = Len(strMsg)
End If
intLet = intLet + 1
If intLet > intLen Then
intLet = 1
End If
strTmp = Mid(strMsg, intLet, strLen)
Me!lblScroll.Caption = strTmp
If strTmp = Space(strLen) Then
intLet = 1 'Re-start scrolling
End If
End Sub
Thanks in advance
Chruchdatabase that I am developing is made in many languages, so for the
welcoming greetings also should be made in languages.
It works when I derictly have the string in the VBA, but now it is not
scrolling although it shows in the intended language, what did I miss here,
here is my revised VBA:
Private Sub Form_Timer()
Static strMsg As String
Static intLet As Integer
Static intLen As Integer
Dim strTmp As String
Dim strGreeting As String
Dim t As Double
Const strLen = 30
t = Time()
Select Case t
'From 00.01(night) am to 10:59 a.m
Case Is < 0.458
' Note: This is message string #1.
strMsg = DLookup("MessageString", "[Lookup Message String_Qry]",
"[FormName] = '" & Me.Name & "' AND [StringNumber] = 1")
strGreeting = [strMsg]
'from 11 am to 2:59 pm
Case 0.458 To 0.6236
' Note: This is message string #2.
strMsg = DLookup("MessageString", "[Lookup Message String_Qry]",
"[FormName] = '" & Me.Name & "' AND [StringNumber] = 2")
strGreeting = [strMsg]
'from 3 pm to 6 p.m
Case 0.6237 To 0.75
' Note: This is message string #3.
strMsg = DLookup("MessageString", "[Lookup Message String_Qry]",
"[FormName] = '" & Me.Name & "' AND [StringNumber] = 3")
strGreeting = [strMsg]
'from 6:01 pm to Midnight
Case Is > 0.75
' Note: This is message string #4.
strMsg = DLookup("MessageString", "[Lookup Message String_Qry]",
"[FormName] = '" & Me.Name & "' AND [StringNumber] = 4")
strGreeting = [strMsg]
Case Else
MsgBox "Fix your computer's clock"
Exit Sub
End Select
If Len(strMsg) = 0 Then
strMsg = Space(strLen) & strGreeting
intLen = Len(strMsg)
End If
intLet = intLet + 1
If intLet > intLen Then
intLet = 1
End If
strTmp = Mid(strMsg, intLet, strLen)
Me!lblScroll.Caption = strTmp
If strTmp = Space(strLen) Then
intLet = 1 'Re-start scrolling
End If
End Sub
Thanks in advance