473,781 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored Procedure for Access

I am new to Access, so bear with me. I think this is possible, but I
am not sure how to get this going.

I am trying to develop a database that will allow me to create a
manufacturing schedule based on our customer demand and our capacity in
minutes. I have created a table (Demand) that will take our customer
demand, blow through our Bill of Materials and will leave me with a set
of demand that gives me a production work center, the item that I need
to produce, the quantity, and the per unit time to produce the product.

Essentially the table looks like this:

Work_Center
Order
Line
Seq
Item
Due_Date
Qty
Unit_Prod_Time (in minutes)

I have another table (Capacity) that will show the available production
time per day for each work center. The table looks like this:

Production_Date
Work_Center
Capacity (in minutes)

I want to be able to create a new table (I am guessing that I need to
do this through code) that will loop through each line of my demand
data, calculate the total time needed to produce, and compare that to
the capacity for that work center and for the next day available. If
there is enough capacity available in the day to do that order, I want
a line written into that new table that will assign the given
production date to the line of demand. I need to keep a running total
of scheduled capacity vs. the actual capacity so when a line does not
fit, I can assign it to the next date.

To add a little more complexity to it, if I have already scheduled 100
of 400 available minutes of capacity and my next demand line requires
350 minutes for 35 pieces, I want to be able to split the demand line
to assign 30 pieces due today and the remaining 5 to be due the next
day.

I can do this using Excel fairly easily, but I would like to keep the
application within Access if at all possible.

I am guessing that I need to use a module and create a new table, but
am not real sure how to get started. Thanks in advance for any help.

Nov 20 '06 #1
1 1636
This seems a quite straightforward though possibly time consuming task.
However, I dont know why you would want to create a new table for the
results.
I get the impression you want to make many tables with different names for
each SET of results.
Many new Access users think they will do it like Excel, where you have a
workesheet called
results121106.x ls, results131106.x ls, etc

Generally, the best solution is to have a blank table with all the fields
required for the calculations, do the calculation, and put the results in a
new record.

To flag what day the results are for, have a field called DateCalculated, or
BatchNumber or any other type of dimension description, so you can extract
data for reports based on when the results were calculated or when they are
to be used. You can even erase all the records afterwards if you want.

The procedure to do this can be as simple as an append query or as flexible
as a VB procedure that opens all the tables and writes the new records. My
bet is you will need either a number of queries, but I think a VB function
or procedure would give you more flexibility.

Do a search in this group on opening tables with code.

A rough example of code is included below -

dim DAOWork_Center as dao.recordset
dim cdb as dao.database
set cdb = currentdb
set DAOWork_Center = cbd.openrecords et("select * from Work_Center where
Due_Date >= '1/12/2006',dbopensna phot)
do while not DAOWork_Center. eof

' Look up other tables, calculate values, put them in the results table
here

cdb.execute "insert into Resultstable fields ......... etc"

DAOWork_Center. movenext
loop
I hope this gives you some ideas

Cheers


<KR*****@gmail. comwrote in message
news:11******** **************@ j44g2000cwa.goo glegroups.com.. .
I am new to Access, so bear with me. I think this is possible, but I
am not sure how to get this going.

I am trying to develop a database that will allow me to create a
manufacturing schedule based on our customer demand and our capacity in
minutes. I have created a table (Demand) that will take our customer
demand, blow through our Bill of Materials and will leave me with a set
of demand that gives me a production work center, the item that I need
to produce, the quantity, and the per unit time to produce the product.

Essentially the table looks like this:

Work_Center
Order
Line
Seq
Item
Due_Date
Qty
Unit_Prod_Time (in minutes)

I have another table (Capacity) that will show the available production
time per day for each work center. The table looks like this:

Production_Date
Work_Center
Capacity (in minutes)

I want to be able to create a new table (I am guessing that I need to
do this through code) that will loop through each line of my demand
data, calculate the total time needed to produce, and compare that to
the capacity for that work center and for the next day available. If
there is enough capacity available in the day to do that order, I want
a line written into that new table that will assign the given
production date to the line of demand. I need to keep a running total
of scheduled capacity vs. the actual capacity so when a line does not
fit, I can assign it to the next date.

To add a little more complexity to it, if I have already scheduled 100
of 400 available minutes of capacity and my next demand line requires
350 minutes for 35 pieces, I want to be able to split the demand line
to assign 30 pieces due today and the remaining 5 to be due the next
day.

I can do this using Excel fairly easily, but I would like to keep the
application within Access if at all possible.

I am guessing that I need to use a module and create a new table, but
am not real sure how to get started. Thanks in advance for any help.

Nov 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1658
by: 8leggeddj | last post by:
Hello, I am having a problem when using access xp as a frontend for sql server 2000. I have been trying to update a number of stored procedures (Just simple adding fields etc) which results in access crashing with event ID 1000 and 1001. Does anyone have any ideas as to what could be the problem? Thanks in advance..
2
11709
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. tCetecM1CUST (SQL Table that contains the Customer Information) tAccountingDetail (SQL Table that contains the information in the form) frmAccountingEntry (Access form used to enter data) spGetCustomerInformation (Stored Procedure which returns data using...
8
9872
by: Mark Flippin | last post by:
This is for a reporting problem using: Access 2000 SQL Server 2000 Both at SP3 I've a stored procedure in SQL Server 2000 which builds a result set from a disparate set of tables, utilizing a temp table. The procedure takes two parameters to specify the criteria on selecting the table information for inclusion in the result set, builds the temp table,
0
2581
by: billmiami2 | last post by:
Perhaps many of you MS Access fanatics already know this, but it seems that stored procedures and views are possible in Jet. I thought I would leave this message just in case it would help anyone. I discovered this the other day while doing some experiments with ADO and ADO.NET. Basically, I wanted to run a stored MS Access query with parameters using the syntax Execute MyProcedure @Param1, @Param2...
5
3486
by: Tim Marshall | last post by:
I was following the thread "Re: Access Treeview - Is it Safe Yet?" with interest and on reading the post describing Lauren Quantrell's SmartTree, I've run into something I don't understand: Stored Procedures. I thought stored pricedures were an Oracle/MS SQL Server thing and don't know how they work with Access Jet. I've looked at some of the help on stored procedures in A2003, but really don't understand what's going on. Can someone...
2
5459
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
6
9908
by: Peter Neumaier | last post by:
Hi, I am trying to select some data through a stored procedure and would like to store the result in a local access table. Is that possible? Can somebody provide an example? Thanks&regards! Peter
2
4108
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
14
4601
by: jehugaleahsa | last post by:
Hello: I am working with Oracle .NET Stored Procedures. I would like to know how to return the results of a SELECT statement. I have tried returning a OracleRefCursor and a DataTable, but nothing seems to work. What data type must I return for this to be accepted as .NET stored procedure?
2
4090
by: acw | last post by:
On a SQL Server 2000 db I would like to setup a stored procedure that accesses couple tables and runs the extended stored procedure xp..cmdshell. The goal is to grant users with limited privileges the right to run the stored procedure but not the rights to directly access either the referenced tables or the extended stored procedure. TIA!
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10143
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10076
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.