Repeat

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Have a report based on a query with 100 records. Using a
calculation in a text box that says ="Pallet#" &
(txtLineCount\5+1) which in turn repeats pallet numbers
every 4th record. Example: Record 1-4 is Pallet#1,
Record 5-8 is Pallet#2, etc. Have a text box called
txtLineCount that says =1 in the control source. This
calculation works fine for the first four records, but
after that it goes to every 5 records. Had written a few
weeks ago, and thought it was working but not quite.
Tried different calculations such as 4+1 and some iif
statements but nothing is working. Is there something I
could add to this to make it work? Thanks!
 
I don't understand WHY it's not working, but have you
tried using an IIf statement?

=IIf([txtLineCount]= 1,[txtLineCount]\5+1,[txtLineCount]\5)

HTH
Kevin Sprinkel
 
I have tried this Iif statement. Still does not work,
works for first four then goes to five. What is the
backslash doing in this statement? If I put in 4 +1 it
goes to every three.
-----Original Message-----
I don't understand WHY it's not working, but have you
tried using an IIf statement?

=IIf([txtLineCount]= 1,[txtLineCount]\5+1,[txtLineCount] \5)

HTH
Kevin Sprinkel
-----Original Message-----
Have a report based on a query with 100 records. Using a
calculation in a text box that says ="Pallet#" &
(txtLineCount\5+1) which in turn repeats pallet numbers
every 4th record. Example: Record 1-4 is Pallet#1,
Record 5-8 is Pallet#2, etc. Have a text box called
txtLineCount that says =1 in the control source. This
calculation works fine for the first four records, but
after that it goes to every 5 records. Had written a few
weeks ago, and thought it was working but not quite.
Tried different calculations such as 4+1 and some iif
statements but nothing is working. Is there something I
could add to this to make it work? Thanks!
.
.
 
My apologies. The ubiquitous abbreviation frequently
prevents communication.

"S/B" meant "should be", i.e., I would try the Control
Source set to:

=IIf([txtLineCount]<=4,[txtLineCount]\5+1,[txtLineCount]\5)
 
That's OK, I tried this & still doesn't work. If you
think of something else, let me know. I appreciate all
your help. This one is a pain.....
-----Original Message-----
My apologies. The ubiquitous abbreviation frequently
prevents communication.

"S/B" meant "should be", i.e., I would try the Control
Source set to:

=IIf([txtLineCount]<=4,[txtLineCount]\5+1,[txtLineCount] \5)
-----Original Message-----

the text line control source. What is SB?
.
.
 
Have a report based on a query with 100 records. Using a
calculation in a text box that says ="Pallet#" &
(txtLineCount\5+1) which in turn repeats pallet numbers
every 4th record. Example: Record 1-4 is Pallet#1,
Record 5-8 is Pallet#2, etc. Have a text box called
txtLineCount that says =1 in the control source. This
calculation works fine for the first four records, but
after that it goes to every 5 records. Had written a few
weeks ago, and thought it was working but not quite.
Tried different calculations such as 4+1 and some iif
statements but nothing is working.


You're so close. Look at txtLineCount and txtLineCount\5:
Cnt Cnt\5+1 (Cnt-1)\5+1
1 1 1
2 1 1
3 1 1
4 1 1
5 2 1
6 2 2
7 2 2
8 2 2
9 2 2
10 3 2
11 3 3
. . .

\ is the integer divide operator, it discards any fractional
part of the result of the divide.
 
Sorry I couldn't help. I suggest reposting your problem;
I'm sure one of the MVP's will know how to solve it.

Good luck.
Kevin Sprinkel
 
OK thanks for all your help!
-----Original Message-----
Sorry I couldn't help. I suggest reposting your problem;
I'm sure one of the MVP's will know how to solve it.

Good luck.
Kevin Sprinkel


.
 
Back
Top