Option Compare Database
Option Explicit
Dim i, j, k
Function sam0401()
Dim x As Integer
x = InputBox("Get number 1 to 3", "for if command", 1)
If x = 1 Then sam0401 = "one"
If x = 2 Then sam0401 = "two"
If x = 3 Then sam0401 = "three"
End Function
Function sam0402()
Dim x, y
sam0402 = ""
x = InputBox("Get number 1 to 3", "for if command", 1)
If x = 1 Then sam0402 = "*"
If x = 2 Then
For y = 1 To 2: sam0402 = sam0402 & "*": Next
End If
If x = 3 Then
For y = 1 To 3: sam0402 = sam0402 & y & Chr(13) & Chr(10): Next
End If
End Function
Function sam0403()
i = InputBox("Get number 1 to 100", "for if command", 80)
For j = 1 To i
If j Mod 5 <> 0 And j Mod 7 <> 0 Then
sam0403 = sam0403 & j & Chr(13) & Chr(10)
Else
sam0403 = sam0403 & j & "*" & Chr(13) & Chr(10)
End If
Next
End Function
Function sam0404()
i = InputBox("Get number 1 to 100", "for if command", 80)
For j = 1 To i
sam0404 = sam0404 & j
If j Mod 5 = 0 Then
sam0404 = sam0404 & " mod 5"
Else
If j Mod 7 = 0 Then
sam0404 = sam0404 & " mod 7"
ElseIf j Mod 13 = 0 Then
sam0404 = sam0404 & " mod 13"
End If
End If
sam0404 = sam0404 & Chr(13) & Chr(10)
Next
End Function
Function sam0405()
i = InputBox("Get number 1 to 100", "for if command", 80)
For j = 1 To i
k = j Mod 5
Select Case k
Case 1: sam0405 = sam0405 & " : one"
Case 2: sam0405 = sam0405 & " : two"
Case Else: sam0405 = sam0405 & " : may be three , four or zero"
End Select
sam0405 = sam0405 & Chr(13) & Chr(10)
Next
End Function
|