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!

Programming Using Mod Command

Status
Not open for further replies.

JBuckley2000

Vendor
Oct 27, 2000
58
0
0
US
Hello,

I am having a problem creating a module that will help my ticket database print tickets. On the current table, I have a list of every single part I need to print tickets for. For each part, I have a column for the stack quanty (stackqty) that is allowed on each pallet. I want the operator to be able to enter in a order quantity then the system will then print out the number of tickets that is needed according to the stack qty. I also want the data to be saved in another table so that we can report on how many tickets are printed each week.

Here is what I was thinking:

Clear the table
Get part number from operator
Get order qty from the operator
Get part data from the table (auto lookup once part number is entered)
Get stack qty from table
Tickets = roundup (quantity/stack qty)

For I=1 to tickets
Mytable.addnew
Mytable("Part") = Part Number
If I = Tickets and
Mytable("quantity") = stack qty or qty mod stack qty

Next I

Print Report

Append data to production history report

End sub

That is the idea I am using right now, but I am unsure about the right code to maybe use. What is hurting me the most is getting the idea of how to make the mod command work. JSF

Jason Facey
jfacey@lithonia.com
 
It sounds like you need a transaction table where each change to your inventory is logged along with date and time. Normally you don't store subtotals or running quantities as it's easier and just as fast to calculate these values on the fly. Use queries against your transaction table to determine date and/or time ranges for the transaction totals.

For determining the amount of tickets why not just take the integer portion of the division and then add 1 if mod doesn't equal 0?

Dim gResult as single, iTickets as integer
gResult = QtyOrdered/Stack
If mod QtyOrdered, Stack <> 0 then
iTickets = gResult
Else
iTickets = int(gResult) + 1
End if


Uncle Jack
 
Hey Jack,

That would work perfectly and I can see where that would be helpful, but I am needing to take the remainder number to be printed on the last ticket...so we can print the move ticket and have the correct number of parts on it. I need the order quantity on each ticket.

Thanks! JSF

Jason Facey
jfacey@lithonia.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top