I have a query.
I need to update one of the fields.
I need to update it in the next order;
1
1
1
2
2
2
3
3
3
and so on...
Meaning i need to write the same number for three records then increase it, then again to write three times and so on..until the end of the query.
There is about 2'000 records..kinda too much for manual entry.
What i have tried to do so far:
I have created a function: fnIncreament:
Function fnIncrement()
If Counter < 3 Then
Counter = Counter + 1
fnIncrement = Number
Else
Counter = 1
Number = Number + 1
fnIncrement = Number
End If
End Function
Where Counter and Number are the variables declared on module level, so they retain their value from call to call.
What i am getting:
the same number in the query field..does not increament..
What am i doing wrong ?
Thanks for any suggestions!
I need to update one of the fields.
I need to update it in the next order;
1
1
1
2
2
2
3
3
3
and so on...
Meaning i need to write the same number for three records then increase it, then again to write three times and so on..until the end of the query.
There is about 2'000 records..kinda too much for manual entry.
What i have tried to do so far:
I have created a function: fnIncreament:
Function fnIncrement()
If Counter < 3 Then
Counter = Counter + 1
fnIncrement = Number
Else
Counter = 1
Number = Number + 1
fnIncrement = Number
End If
End Function
Where Counter and Number are the variables declared on module level, so they retain their value from call to call.
What i am getting:
the same number in the query field..does not increament..
What am i doing wrong ?
Thanks for any suggestions!