Hi all, I am facing issue with this error "91" object variable or with block variable not set at this line of code. Can you help me?
I have declare and set the variable at the start of my coding.
I have declare and set the variable at the start of my coding.
Code:
' loop on each item in maximrecords collection
[B] For i = 1 To modifyRecords.Count[/B] This line of code turn yellow
Set rec = modifyRecords.Item(i)
thisLoss = 0
If Nz(rec.NettWeight, 0) <> 0 Then _
thisLoss = Nz(rec.GrossWeight, 0) - Nz(rec.NettWeight, 0) / Nz(rec.NettWeight, 0) * 100
'Insert data to MaximMaintable by using SQL
Call fnAnySQL(strSQL, rec.GLGPO, rec.Mill, rec.solidPrinting, rec.Reference, _
rec.FunctionalFinish, rec.MRName, rec.Buyer, rec.MXDPO, _
rec.GLA, rec.StyleNO, rec.FabricDelivery, rec.GarmentDelDate, _
rec.Country, rec.Fabrication, rec.afterFabricationWashWidth, rec.Width, _
rec.FinishedGoods, rec.GSMPerSqYd, rec.GSMAfterWash, rec.Colour, _
rec.GroundColour, rec.ComboName, rec.LabDipCode, rec.samplerRequirement, _
rec.GrossWeight, rec.NettWeight, rec.Lbs, thisLoss, rec.Yds, rec.Remarks, _
rec.GarmentSketch, rec.GarmentSketch2, rec.GarmentSketch3, rec.GarmentSketch4, _
rec.GarmentSketch5, rec.PrintedRemarks, rec.FabricWeight, rec.UnitPrice, rec.Line, _
rec.PPSample, rec.POStatus, rec.Amendment, rec.sketchMark1, rec.sketchMark2, _
rec.sketchMark3, rec.sketchMark4, rec.sketchMark5)
Next