When I compile I am getting an expected array error. I have declared the variables so I don't know why I would be getting this error. The line causing the error is highlighted in blue. I would greatly appreciate any help.
Code:
'Module
Public Function GetDataTypeTF(D As Field, ByRef lTbl As Integer, ByRef lRow As Integer, ByRef lFld As Integer, intCol As Integer) As String
' **********************************************************************************
' *** THIS FUNCTION READS THE FIELDS FROM THE TABLE AND CREATES A REPORT OF IT******
' **********************************************************************************
Dim dBase As DAO.Database
Dim xlApp As Object
Dim wbExcel As Object
Dim fRow As Long
Set dBase = CurrentDb
Dim IndexExists As Boolean
Dim IndexText As String
Dim idx As DAO.Index
Dim prp As DAO.Property
Dim strIdx As DAO.Index
Dim strCol As String
Dim strTbl As String
Dim strFld As String
Dim ConvColLet As String
Dim intColCnt As Integer
With goXL.ActiveSheet
.Range("A" & lRow) = dBase.TableDefs(lTbl).Fields(lFld).SourceTable
For intColCnt = 2 To intCol
[Blue] strCol = ConvColLet(intColCnt) [/blue]
.Range(strCol & lRow) = dBase.TableDefs(lTbl).Fields(lFld).Name
Next intCol
End With
End Function
'Other Function
Public Function ConvColLet(intCol As Integer) As String
' ******************************************************************************
' *** THIS FUNCTION RETURNS A LETTER FOR A COLUMN NUMBER FOR CELL REFERENCES ***
' ******************************************************************************
'strLeftLetter = ConvColLet(intFirstColumn)
Select Case intCol
Case 1
ConvColLet = "A"
Case 2
ConvColLet = "B"
Case 3
ConvColLet = "C"
Case 4
ConvColLet = "D"
Case 5
ConvColLet = "E"
Case 6
ConvColLet = "F"
Case 7
ConvColLet = "G"
Case 8
ConvColLet = "H"
Case 9
ConvColLet = "I"
Case 10
ConvColLet = "J"
Case 11
ConvColLet = "K"
Case 12
ConvColLet = "L"
Case 13
ConvColLet = "M"
Case 14
ConvColLet = "N"
Case 15
ConvColLet = "O"
Case 16
ConvColLet = "P"
Case 17
ConvColLet = "Q"
Case 18
ConvColLet = "R"
Case 19
ConvColLet = "S"
Case 20
ConvColLet = "T"
Case 21
ConvColLet = "U"
Case 22
ConvColLet = "V"
Case 23
ConvColLet = "W"
Case 24
ConvColLet = "X"
Case 25
ConvColLet = "Y"
Case 26
ConvColLet = "Z"
Case 27
ConvColLet = "AA"
Case 28
ConvColLet = "AB"
Case 29
ConvColLet = "AC"
Case 30
ConvColLet = "AD"
Case 31
ConvColLet = "AE"
Case 32
ConvColLet = "AF"
Case 33
ConvColLet = "AG"
Case 34
ConvColLet = "AH"
Case 35
ConvColLet = "AI"
Case 36
ConvColLet = "AJ"
Case 37
ConvColLet = "AK"
Case 38
ConvColLet = "AL"
Case 39
ConvColLet = "AM"
Case 40
ConvColLet = "AN"
Case 41
ConvColLet = "AO"
Case 42
ConvColLet = "AP"
Case 43
ConvColLet = "AQ"
Case 44
ConvColLet = "AR"
Case 45
ConvColLet = "AS"
Case 46
ConvColLet = "AT"
Case 47
ConvColLet = "AU"
Case 48
ConvColLet = "AV"
Case 49
ConvColLet = "AW"
Case 50
ConvColLet = "AX"
Case 51
ConvColLet = "AY"
Case 52
ConvColLet = "AZ"
Case 53
ConvColLet = "BA"
Case 54
ConvColLet = "BB"
Case 55
ConvColLet = "BC"
Case 56
ConvColLet = "BD"
Case 57
ConvColLet = "BE"
Case 58
ConvColLet = "BF"
Case 59
ConvColLet = "BG"
Case 60
ConvColLet = "BH"
Case 61
ConvColLet = "BI"
Case 62
ConvColLet = "BJ"
Case 63
ConvColLet = "BK"
Case 64
ConvColLet = "BL"
Case 65
ConvColLet = "BM"
Case 66
ConvColLet = "BN"
Case 67
ConvColLet = "BO"
Case 68
ConvColLet = "BP"
Case 69
ConvColLet = "BQ"
Case 70
ConvColLet = "BR"
Case 71
ConvColLet = "BS"
Case 72
ConvColLet = "BT"
Case 73
ConvColLet = "BU"
Case 74
ConvColLet = "BV"
Case 75
ConvColLet = "BW"
Case 76
ConvColLet = "BX"
Case 77
ConvColLet = "BY"
Case 78
ConvColLet = "BZ"
Case 79
ConvColLet = "CA"
Case 80
ConvColLet = "CB"
Case 81
ConvColLet = "CC"
Case 82
ConvColLet = "CD"
Case 83
ConvColLet = "CE"
Case 84
ConvColLet = "CF"
Case 85
ConvColLet = "CG"
Case 86
ConvColLet = "CH"
Case 87
ConvColLet = "CI"
Case 88
ConvColLet = "CJ"
Case 89
ConvColLet = "CK"
Case 90
ConvColLet = "CL"
Case 91
ConvColLet = "CM"
Case 92
ConvColLet = "CN"
Case 93
ConvColLet = "CO"
Case 94
ConvColLet = "CP"
Case 95
ConvColLet = "CQ"
Case 96
ConvColLet = "CR"
Case 97
ConvColLet = "CS"
Case 98
ConvColLet = "CT"
Case 99
ConvColLet = "CU"
Case 100
ConvColLet = "CV"
Case Else
ConvColLet = "CZ"
End Select
End Function