Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to get report to work

Status
Not open for further replies.

lipin

MIS
Sep 10, 2002
7
0
0
US
I have a report that has 3 grouping levels:
1- Carton #
2- Employee #
3- Error Code

For each carton there can be multilple employees that made errors and multiple errors (separate error codes) for each employee. Sometimes it is just one empl with one error code.

Well in the footer of the Error Code I am trying to get the
Carton #, Empl #, Sum of units for the error code, and then one more textbox.

This is an auditor's report and the auditor only gets credit for the carton once no matter how many errors are inside. So in the fourth textbox referred to earlier I am trying to get a 1 to show up in the Error Code footer the first time it prints per carton number, and a 0 to show in the footer if there are multiple errors or employeess.

Like this:

Carton# 999999
error code A footer w/ [empl#] and [error code] 1
error code B footer w/ [empl#] and [error code] 0
error code C footer w/ [empl#] and [error code] 0

Carton# 222222
error code X footer w/ [empl#] and [error code] 1
error code Y footer w/ [empl#] and [error code] 0

Carton# 666666

etc. etc.

Have tried many counts and counting different counts and can't get anything. Is there some code and if so what is syntax like if you want to say 'Print a 1 if this is the first time the error code footer shows/ per carton. Otherwise a zero'? Driving me crazy!!
 
Hi,
You can add a textbox (txtUnitErrors) to the group footer. The Control Source for that will be the "count" of the rows found. Then, in the On Format event for the Group Footer, you can test for the quantity found in txtUnitErrors. You can then set the message, depending on your conditional statements.
Here is a sample:
If txtUnitErrors > 1 Then
txtUnitErrors = "1"
else
txtUnitErrors = "0"
end if HTH,
Randy Smith
California Teachers Association
 
Hi,
It occurs to me that txtUnitErrors is text, so you may need to convert the contents of the textbox to an integer. You can use the following function inside the "if" statement:
if Cint(txtUnitErrors) > 1 Then
etc........ HTH,
Randy Smith
California Teachers Association
 
Thanks for the response. Tried your example. Only I need the counter for the error code footer to start over at 1 each time there is a new carton. Then I could apply your example.
 
Hi,
The counter is suppose to start over again every time there is a new item to count (after the group footer has printed). As a test, can you add the counter to each group footer, and see what you get?
HTH,
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top