Hi ppl,
SO i have this code:
Code:
Set IRS = CurrentDb.OpenRecordset("Select * FROM ITEMS where [deactivate] = false and [ManualInvoicing] = false", dbOpenDynaset)
Set Tmp = CurrentDb.OpenRecordset("TmpPriceList", dbOpenDynaset)
Do Until IRS.EOF
ItName = IRS(1)
StdQty = IRS(2)
Cost = IRS(3)
Sched = IRS(5)
Tmp.AddNew
Tmp!ItemName = ItName
Tmp!CostPrice = Cost
Tmp!StdQty = StdQty
Col = 1
Do Until Col = 12
Percent = 0.1 * Col
TMP REFERENCE: THIS IS WHERE I NEED TO DO Tmp!"Col" & Col <<<<<This is where i create it
Qty = StdQty * Percent
If Qty < 1 Then
Else
Call Priceit(ItName, StdQty, Cost, Sched, Qty, Col)
TMPREFERENCE = invamt <<<<<<<<<<This is where i use it
End If
Tmp.Update
Col = 1 + Col
Loop
IRS.MoveNext
Loop
So the idea is i have 10 columns literally named Col1 Col2 and so forth.
As the Variable COL goes up during the loop then the figure is "Invamt" is saved into the column on Tmp according to the variable.
Thus When Col = 1
Tmp!Col1
when it loops and Col = 2
The the Tmp! becomes Tmp!Col2
Im sure i should be using TableDef but ive never used it and it confused me quite a bit
Thanks for any help u can give
GAngel