I have developed an array referenced in the code below. What I want to happen is if the user enters one of the user IDs in the array, a report will display. If the user ID does not match, another form will load. However, I keep getting a "Type Mismatch" error. Any ideas?
Code:
Dim strText0 As String
strText0 = Form_frmRVNumber.Text0.Value
Dim strRVNum() As String
ReDim strRVNum(0 To 11) As String
strRVNum(0) = "User1"
strRVNum(1) = "User2"
strRVNum(2) = "User3"
strRVNum(3) = "User4"
strRVNum(4) = "User5"
strRVNum(5) = "User6"
strRVNum(6) = "User7"
strRVNum(7) = "User8"
strRVNum(8) = "User9"
strRVNum(9) = "User10"
strRVNum(10) = "User11"
strRVNum(11) = "User12"
If strText0 Is strRVNum Then
Dim stDocName As String
stDocName = "rptTimeTrack"
DoCmd.OpenReport stDocName, acPreview
DoCmd.Maximize
End If