The revolutionary project management tool is here! Plan visually with a single glance and make sure your projects get done.
Private Sub Form_Load() '////// For recalculating quantities as a percent of Total Shipped. /////// Dim rs As Object, varPctShip As Single, varCurrVal As Single varPctShip = 0 varCurrVal = 0 Set rs = CurrentDb.OpenRecordset("tbl_temp_freight_sort_cost") With rs rs.MoveFirst '////// Cycle through columns, regardless of name and number. ////////// ' 1st Column is referenced as column zero. For i = 2 To rs.Fields.Count - 1 varCurrVal = rs.Fields(i).Value If varCurrVal <> 0 Then varPctShip = varCurrVal / (rs.Fields(1).Value) .Edit !rs.Fields(i) = varPctShip .Update End If Next rs.MoveNext End With End Sub
Join the community of 500,000 technology professionals and ask your questions.