raziel3
Registered User.
- Local time
- Yesterday, 21:42
- Joined
- Oct 5, 2017
- Messages
- 311
I am sorry if i phrased the question wrong but let me explain.
I am using a public function to open a recordset, It has 5 fields. StartDate, MRange, ENIS, CNIS, ZNIS
My question is can I return !CNIS within the function instead of having to do over a whole new function just to get that field?
Maybe something along the lines of:
EmpWNIS(inpGross As Double, inpWDate As Date, inpRDate As Variant), Column_!CNIS or
EmpWNIS(inpGross As Double, inpWDate As Date, inpRDate As Variant), Column_!ENIS
I am using a public function to open a recordset, It has 5 fields. StartDate, MRange, ENIS, CNIS, ZNIS
Code:
Public Function EmpWNIS(inpGross As Double, inpWDate As Date, inpRDate As Variant) As Double
Dim strPeriodEnd As String
Dim strWENIS As String
Dim RetDate As Date
RetDate = IIf(inpRDate = 0, inpWDate, inpRDate)
strPeriodEnd = "#" & Format(inpWDate, "m/d/yyyy") & "#"
strWENIS = "SELECT TOP 1 * FROM tblNIS WHERE [EffDate] <= " & strPeriodEnd & " And WRange <= " & inpGross _
& " ORDER BY [EffDate] DESC , WRange DESC"
With CurrentDb.OpenRecordset(strWENIS)
If Not (.BOF And .EOF) Then
If RetDate < inpWDate Then
EmpWNIS = 0
Else
EmpWNIS = !ENIS
End If
End If
End With
End Function
My question is can I return !CNIS within the function instead of having to do over a whole new function just to get that field?
Maybe something along the lines of:
EmpWNIS(inpGross As Double, inpWDate As Date, inpRDate As Variant), Column_!CNIS or
EmpWNIS(inpGross As Double, inpWDate As Date, inpRDate As Variant), Column_!ENIS