Hi,
Last month some of you were kind enough to help me with some date genreation.
This function uses a table 'tblHolidays' to exclude any days that are holidays (basically when students are not in). The query the function is being used has one field where the name of the organisation is specified. Now, the problem is that some organisations have different holiday dates. I've created another table (tblHolidays2) which is identical in structure to the one already being used below but has slightly different holiday days.
I'm thinking to modify the code below to something as follows (meta code):
How do I actually access the fieldProvider value in the same record and would the above idea work? Is changing a const ok?
Last month some of you were kind enough to help me with some date genreation.
Code:
Public Function fncInWeekDay(ByVal dte As Date, strWeekDay As String) As Boolean
Const holiday_tbl As String = "tblHolidays"
Const holiday_field As String = "HolidayDate"
Dim lngCount As Long
fncInWeekDay = (InStr(1, strWeekDay, Weekday(dte, 2) & "") > 0)
If fncInWeekDay Then
lngCount = DCount("1", holiday_tbl, holiday_field & "=#" & Format(dte, "mm\/dd\/yyyy") & "#")
fncInWeekDay = fncInWeekDay And (lngCount = 0)
End If
End Function
I'm thinking to modify the code below to something as follows (meta code):
Code:
If [myquery]![fieldProvider]="non_standard_provider" Then
Const holiday_tbl As String = "tblHolidays2"
Else
Const holiday_tbl As String = "tblHolidays2
Endif
How do I actually access the fieldProvider value in the same record and would the above idea work? Is changing a const ok?