bigmaxnosauce
Registered User.
- Local time
- Today, 13:27
- Joined
- Nov 14, 2002
- Messages
- 12
I have a table with fields repname, 1-24 I want to reference a column, i.e. 4, this number will be taken from a previous function.
Dim Mon As Double
Dim Yr As Double
Dim Enddate As Date
Dim Col As String
Dim OD As Currency
Enddate = Me.EndingDate
Mon = Month(Enddate)
Yr = Year(Enddate)
Col = Mon + Yr - 2003 - 2
OD = DLookup(""" & Col & """, "Overdraw", "RepName = '" & [RepName] & "'")
Me.Overdraw = OD
How can I get this to work, there is always an error in the dlookup with the Col portion.
Please Help me your my only hope.
Dim Mon As Double
Dim Yr As Double
Dim Enddate As Date
Dim Col As String
Dim OD As Currency
Enddate = Me.EndingDate
Mon = Month(Enddate)
Yr = Year(Enddate)
Col = Mon + Yr - 2003 - 2
OD = DLookup(""" & Col & """, "Overdraw", "RepName = '" & [RepName] & "'")
Me.Overdraw = OD
How can I get this to work, there is always an error in the dlookup with the Col portion.
Please Help me your my only hope.