Option Explicit
Public Function GetEmp_ID() As String
Dim TempEmp_ID As String
Randomize Timer
' generate a new employee ID
TempEmp_ID = Left(rsEmployee("fName"), 1)
If Len(rsEmployee("minit")) = 0 Then
TempEmp_ID = TempEmp_ID & "-"
Else
TempEmp_ID = TempEmp_ID & _
Left(rsEmployee("minit"), 1)
End If
TempEmp_ID = TempEmp_ID & _
Left(rsEmployee("minit"), 1)
TempEmp_ID = TempEmp_ID & Int(Rnd(1) * 1000 + 10000)
TempEmp_ID = TempEmp_ID & "F"
GetEmp_ID = UCase(TempEmp_ID)
End Function
|