Can a class have multiple contructors? I know u can in java, but I cannot seem to get it to work in Access.
Example, if have a Resource Class, I want to initialise it and pass a param through to it. If a guy is currently working days, i want the class to know this so it will allocate the correct number of hours. Or if a guy works on a Friday, I need to set the basic hours to 7. I thought i could have:
Private Sub Class_Initialize(d As Date)
' Set default values for Ringway class
Me.ResourceType = "R"
Me.WeeklyHours = 39
If Weekday(CDate(rsHourBands!WorksDate)) = vbSunday Then
Me.BasicHours = 8
Else
Me.BasicHours = 7
End If
End Sub
then instantiate it by
dim test as new testClass
set test = new testClass(rst(0)),
where rst(0) is a date
Nick (Everton Rool OK!)
Example, if have a Resource Class, I want to initialise it and pass a param through to it. If a guy is currently working days, i want the class to know this so it will allocate the correct number of hours. Or if a guy works on a Friday, I need to set the basic hours to 7. I thought i could have:
Private Sub Class_Initialize(d As Date)
' Set default values for Ringway class
Me.ResourceType = "R"
Me.WeeklyHours = 39
If Weekday(CDate(rsHourBands!WorksDate)) = vbSunday Then
Me.BasicHours = 8
Else
Me.BasicHours = 7
End If
End Sub
then instantiate it by
dim test as new testClass
set test = new testClass(rst(0)),
where rst(0) is a date
Nick (Everton Rool OK!)