473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Grouping data when inserting

24
Hi,

I need some assistance or ideas on ho to group data when inserting to a MS SQL table.

I currently have a continuous form that an "overview" of my inventory including vendor details, stock levels and sales history.

I now need to create a routine that allows the creation of purchase orders directly from the continuous form. Example, when a user selects item 1234 to be ordered from vendor 1, but at the same time selects item 1222 to be order from vendor 2, I need to create a purchase order for each vendor and all items selected to be purchased.

My question is, how do I group item and vendor and then insert/create a separate purchase order for each vendor? Each purchase order might have multiple items on it.
Jul 27 '15 #1

✓ answered by Seth Schrock

Create a subform for your PODtl table that is linked to a parent form bound to the POHdr table. For an example of this, look at the Northwind sample database provided by Microsoft. Once you select the user to log in as, click New Purchase Order (or press Alt + P).

7 1542
Seth Schrock
2,965 Expert 2GB
A great deal depends on how your tables are structured. I know how I would do it, but that is because I know how I would have my tables structured. Please let us know what your table(s) looks like into which the user in entering the item 1234 from vendor 2 and item 1222 from vendor 2 as well as the table (should really be tables) for your purchase order.
Jul 27 '15 #2
DoubleD
24
Hi Seth,

As this is a new application that we're designing for the customer, I haven't even started structuring the tables for the purchase orders yet (I agree that it should be more than one table).

The idea is to dump the data into a temporary table/s and from there write it into 2 MS SQL tables. I'm just not sure how I would go about creating a purchase order for one vendor with associated items and at the same time a separate purchase order for a different vendor and associated items.
Jul 27 '15 #3
Seth Schrock
2,965 Expert 2GB
How I would do it would be to have a Purchase Orders table (tblPurchaseOrders) and a Purchase Order Details (tblPurchaseOrderDetails). If you think of looking at an invoice, you have company information, shipping address, billing address, delivery method, etc. at the top. This would be the tblPurchaseOrders information. Then in the middle, you have all items purchased. This is the tblPurchaseOrderDetails.

However, I wouldn't do a temp table as this means you would have to copy records and delete records and this just creates a mess. What you can do is to have a field in tblPurchaseOrders that marks it as temporary. This can be done with either a status field that allows you to have "New", "Approved", and "Ordered" statuses, or just a simple Yes/No field for whether it has been verified.
Jul 27 '15 #4
DoubleD
24
This sounds perfectly normal. The tables in MS SQL where I will insert my data are called tblPOHDR(holding the PO header info, date created, document type, document number, vendor info) and tblPODtl (stock item, quantity ordered, cost, etc).

I guess i should go back 1 step and tell you how i get my data and what my idea is to create the purchase order from Access.

I have created a continuous form in Access that is based on a query. The query is selecting data from 2 linked SQL tables with a left join between the 2 tables. The reason for the join is to get supplier contact details through to my form. Currently on the form I am displaying stock items with their associated sales history and projected ordering quantities.

My idea is to have a "TO ORDER" field (a text box) on the form where the buyers will fill in how many of an item they want to order from a vendor (some items have multiple vendors allocated to them).

First off it looks like my continuous form design is not really going to work as the "TO ORDER" field replicates any value that I enter into it to all items loaded on the form, so I must rethink the design first of all.
Jul 27 '15 #5
DoubleD
24
Time to revisit this question as I finally got m continuous form to work the way I need it.

By the way, I am using Access 2007 and am still very inexperienced in Access

I have created a POHdr table and a PODtl table. The POHdr table will have the Document Number, Vendor number and Name, Date Created, Delivery Method and Document Totals. The PODtl table will contain each item on order line by line, which includes Item Number, Item Description, Quantity Ordered, Unit Cost, Total line Item Cost(quantity * unit cost)

I just need some help figuring out how to create a purchase order per vendor and have all the items (it could be 1 item only or 50 items) ordered from that vendor on the one purchase order.
Jul 29 '15 #6
Seth Schrock
2,965 Expert 2GB
Create a subform for your PODtl table that is linked to a parent form bound to the POHdr table. For an example of this, look at the Northwind sample database provided by Microsoft. Once you select the user to log in as, click New Purchase Order (or press Alt + P).
Jul 29 '15 #7
DoubleD
24
Thanks Seth. I will go look at the Northwind Sample, but it sounds easy enough
Jul 29 '15 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Joachim Klassen | last post by:
Hi all, first apologies if this question looks the same as another one I recently posted - its a different thing but for the same szenario:-). We are having performance problems when...
2
by: Roy Scarisbrick | last post by:
I have a programming issue on an ASP.Net web page. I suspect the issue would apply to any version of ASP though. I have a questionnaire page where a user will answer a bunch of questions with...
3
by: Brad | last post by:
I have a response filter which injects "standard" html into my pages. The filter works fine when the initial stream is small enough not to buffer...or....if I have a large unbuffered stream (i.e. I...
5
by: antonyliu2002 | last post by:
I have 4 forms each on a separate page respectively form1.aspx, form2.aspx, form3.aspx, form4.aspx. On top of each of the four pages there are 4 links which link to the aforementioned 4 pages...
0
by: Nick | last post by:
How do I go about setting a default value for a row when inserting a new record with the DetailsView ? Effectively I need to access the underlying data source and set a column to be a default value...
23
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
1
by: gozzer101 | last post by:
Hello! I have a small problem with grouping data on reports. The situation is that I have an PersonIDnumber, PersonName, NoPurchases and ProductNumbersAllocated. The person ID is just any number,...
1
by: DanielLauJJ | last post by:
When inserting a record into a table, I want SQL Server to generate a number automatically for the Primary Key. (e.g. OrderID is 1, 2, 3 and so on) How to do it? (This behavior is similar to the...
0
by: techuse | last post by:
how to set no data when no data from db in jasper report? i got no data in report when even there is no data in db.but it displays with static fields.how to display with out static field?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.