raziel3
Registered User.
- Local time
- Today, 12:15
- Joined
- Oct 5, 2017
- Messages
- 275
Good Day All
I have the following expression that i want to make into a Public Function. 'Gross' and 'Period End' are variables everything else is stored in a Table called NIS.
DLookup("[Employee NIS]", "NIS", "Range=" & _
DMax("Range", "NIS", "Range<=" & Gross & " AND [Effective Date]=#" & _
Format(DMax("[Effective Date]", "NIS", "[Effective Date]<=#" & Format([Period End], "yyyy-mm-dd") & "#"), "yyyy-mm-dd") & "#"))
How do I go about doing that? The reason is I want to make a Function is because the expression is used in multiple forms and queries so I want to make everything a little more neater.
I have the following expression that i want to make into a Public Function. 'Gross' and 'Period End' are variables everything else is stored in a Table called NIS.
DLookup("[Employee NIS]", "NIS", "Range=" & _
DMax("Range", "NIS", "Range<=" & Gross & " AND [Effective Date]=#" & _
Format(DMax("[Effective Date]", "NIS", "[Effective Date]<=#" & Format([Period End], "yyyy-mm-dd") & "#"), "yyyy-mm-dd") & "#"))
How do I go about doing that? The reason is I want to make a Function is because the expression is used in multiple forms and queries so I want to make everything a little more neater.