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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delicate problem 6

Status
Not open for further replies.

christerhaard

Programmer
Oct 5, 2002
28
0
0
SE
Hmm this will take time to explain. . . ok I have a database where i have a uniqe counter field which is the order number for lets say a computer. The counter is also the computers serial number. But a customer might want to buy 5 computers so instead of makin 5 orders for the same product I have a field that explains to the user that the customer want's 5 pcs of this product. But the problem is that all 5 computers will now get the same serial number both on the sticker in the back of the computer and in the database. Not so good if the customers wants a uniqe individual serial number.

So what I would like to achive is that based on the number of products in the "number of pcs field" I would like the serial number field in the report to get an extention and print ser# 521458-1 and ser# 521458-2 and ser# 521458-3 and so on. The number of print out's of the order sheet is the same as the value in the "number of pcs field".

I have tryed to find a page count field or such but I cant get it right. Please help.

/ Chris

By the way does anyone know how i can make the "number of pcs field" automatically print the same number of copies as the value of the "number of pcs field" based on the code below

DoCmd.OpenReport DocName, acViewPreview, "computer order filter"
 
No problem.

In Design view of your report, click on View, then Sorting and Grouping.

Under Field/Expression select your serial number field. Set Group Header and Group Footer to Yes.

Right-click on the gray bar over the group footer and choose Properties. On the Format tab, set Force New Page to After Section.

That's it!!!!
 
GREAT !!!!!!!!

Has this site been down?? havent been able to get in.

Works better now. . . But there seems to be a problem when trying to print more than 9 build sheets 1 - 9 works fine 10 generates &quot;>&quot; 11 &quot;=&quot; 12 &quot;<&quot; and so on. on the serial number that is. 1234-> / 1234-= / 1234-<

And (naturally) it changes the sorting of the fields in the print out. . . any way to get around that?? I have a certain sorting table where all the groups of products are given a number. So that I easily can sort them in the report but now it seems that the groupheader with MyModifiedSer# takes care of the sorting. = none at all the articles in the build sheet comes out differently every print out!!!

cpu's = 1
Motherboards = 2
Graphiccards = 3

And so on. . .

It makes the building process of a computer alot easier for the builder if it all comes in the same order every time. I sort the products in the query for the report. If not possible to fix = no biggie

Thanks again

Chris Haard
 
Try making this change:
MyModifiedOffertId:IIf([antal_produkter] > 1,[OFFERTER.OffertId] & &quot;-&quot; & Chr(48 + [qty]),[OFFERTER.offertid])

to

MyModifiedOffertId:IIf([antal_produkter] > 1,[OFFERTER.OffertId] & &quot;-&quot; & [qty]),[OFFERTER.offertid])

 
Cosmo and Paul,

You two are great. Turns out this thread is useful to me as well, in a similar vein to what Chris needs. So I've added it to my watched threads along with the last time y'all helped out.

Thanks for your devotion to these forums!
C *~*~*~*~*~*~*~*~*~*~*~*~*
Insanity is a matter of Perception. [yinyang]
 
Paul and Cosmo,

You two are great!!!!! Just tell me were to send a case of beer and I will deliver. . . It works great now and all because of you guy's.

If you guys figure something out so that I can get my article rows back in sorting order too I would realy appreciate it. . .
(&quot;appreciate&quot; looks like err in spelling section of my brain, but. . .)

Sincerely Happy

Chris Haard
 
Chris, you can send the beer to Cosmo, 90% was his work. As for sorting, try sorting you query by the Serial Number and then by Antal.Qty

That should put it in the Right order.

Paul
 
Chris, if changing the sort order in the query doesn't do it then you can do this.

1. Add this expression to a new column in your query
MySortField:IIf([antal_produkter] > 1,Val(OFFERTER.OffertId] & [qty]),[OFFERTER.offertid])
All is does is take the &quot;-&quot; out of the other expression and return a numeric value for MySortField.
2. Save the query
3. Open the Report in Design View.
4. Add the Field MySortField to your Serial Number Group Header but leave your Serial Number field in this Group Header as well
5. On the Tool bar go to View....Sorting and Grouping
6. Change the Field Serial Number Field name to MySortField and sort Ascending.
7. Set the visible property for MySortField to No.

This should return the Serial Numbers in the proper numeric oreder instead of the text sorting it's doing now.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top