Hi All,
I'm in need of a bit of assistance. I have used this type of code countless times before and can't understand why it won't work. I'm basically adding a collection to a paticular item within a collection. However when I run the code I get an object required error.
I'm hoping someone can kindly cast there eye over to see if I have missed anything before I go cross-eyed.
Public Sub RateCodes()
Set colRates = New Collection
AssignRatestocollection "Back Dated Rate Increase", "BDRI"
AssignRatestocollection "Bank Holiday Rate", "BHR"
AssignRatestocollection "Bonus", "BON"
AssignRatestocollection "Call Out Rate", "COR"
AssignRatestocollection "Commission", "COM"
AssignRatestocollection "Day Rate", "DR"
AssignRatestocollection "Discount Rate", "DSR"
AssignRatestocollection "Expenses (Non Taxable)", "ETN"
AssignRatestocollection "Expenses (Taxable)", "ETA"
AssignRatestocollection "Holiday Pay", "HPA"
AssignRatestocollection "Miscellanous", "MISC"
AssignRatestocollection "Night Rate", "NR"
AssignRatestocollection "Overtime Rate", "OVT"
AssignRatestocollection "Placement", "PLC"
AssignRatestocollection "Saturday Rate", "SAT"
AssignRatestocollection "Sleep In Rate", "SIR"
AssignRatestocollection "Stand By Rate", "SBR"
AssignRatestocollection "Standard Rate", "STD"
AssignRatestocollection "Sunday Rate", "SUN"
End Sub
Public Sub AssignRatestocollection(ByVal strRates As String, ByVal strRateCode As String)
Dim icolCount As Long
Set colRatesExportcode = New Collection
colRates.Add strRates
icolCount = colRates.Count
colRatesExportcode.Add strRateCode
colRates.Item(icolCount).Add colRatesExportcode
End Sub
As ever, thank you in advance for any help.
Regards
Stu
Bookmarks