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

Creating multiple forms

Status
Not open for further replies.

aaronmc52

MIS
May 6, 2003
11
US
I have another issue with Access 2000. I have a database that calculates the number of skids that are needed for a particular job. The actual form is what prints out for the user to place on a skid. What I am tryiny to do is get the form to print out multiple forms if the number of skids is greater than one. I have a field that calculates the number of skids needed for the job, now I just need it to create that many forms and have a counter field that syas the skid number (i.e. Skid 1 of 5, Skid 2 of 5 etc...) Does anyone have any insight on how I should go about accomplishing this task?
Thanks,
Aaron
 
Aaron,

You'll probably need to give us a bunch more info to get a more specific answer, but here's how I'd approach this.

I would avoid using a temporary table or records that get added and deleted, though that may be what some others suggest. Temp tables and records lead to bloating of your mdb file and are a PITA.

I would write code to determine the total number of stickers to be printed and then loop through that many times. It might look something like this:
Sub btnPrintSkidLabels_Click()
Dim intTotal As Integer
Dim intThisOne As Integer

'This is where you'll determine how many labels to print
'The number 5 below will be replaced with the product of
'those calculations.
intTotal = 5
intThisOne = 1
Me!txtTotal = intTotal
Do Until intThisOne = intTotal
Me!txtThisOne = intThisOne
Call DoCmd.RunCommand(acCmdPrint)
intThisOne = intThisOne + 1
Loop
End Sub

If you need help determining the numbers for the Total and ThisOne, post back with information about what determines this. If it's stored in a table or on the form, be very specific about the names of all the objects involved and any table relationships inovolved. If it's based on some standard equation, include that.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
I have posted the database on some web space for you to take a look at. You can find it at I figured this would be the easiest way for you to see what I am trying to accomplish. The number of skids field determines how many skids are needed per job by performing the following calculation: =[versionqty]/([sigsperlift]*[liftsperlayer]*[layersperskid]). And the skid % of % is the counter field.

Thanks for your help,

Aaron
 
Aaron,

Not knowing you from Adam, I'd not want to download your mdb. Please don't take that personally, I just don't want to munge my PC.

You should be able to put that calculation right in your code, just adjusting the names so that they refer to controls on your form. Just replace my 5 with your calculation.

Feel free to describe the situation more, but it really looks to me like you should have enough to make a pass at it now and report back with your results. (The code goes in the click event of a button set up to print the form.)

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top