Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-05-2016, 01:18 AM   #1
azeeshan
Newly Registered User
 
Join Date: May 2016
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
azeeshan is on a distinguished road
Append query to receive distributed result

I am developing a database for a warehouse, I want to make an append query that keep repeating itself until a certain condition is met.

For example, I receive bulk quantity shipment in our warehouse and then we palletize them according to the packing type. I want to have following transactions
S.No Item Code Quantity Rcvd
1 A112550 145 cases


suppose A pallet is made with 40 cases, than upon executing of query, I want to receive result on subform as below;
s.no Item code Qty pallet
1. A112550 40 1
2. A112550 40 1
3. A112550 40 1
4. A112550 25 1


Hope I have explained my query requirement clear. If append query is not workable then VB code will also be welcome.

azeeshan is offline   Reply With Quote
Old 05-05-2016, 01:47 AM   #2
NauticalGent
Pristine Curmudgeon
Gold Supporter
 
NauticalGent's Avatar
 
Join Date: Apr 2015
Location: Naples, Italy (EXPAT from Virginia)
Posts: 1,594
Thanks: 337
Thanked 203 Times in 179 Posts
NauticalGent has a spectacular aura about NauticalGent has a spectacular aura about
Re: Append query to receive distributed result

Good morning azeeshan,

It is difficult to answer this question directly without knowing a little more about how your tables are set up/structured.

Your output could be achieved with a simple equation or a For/Each Loop depending on the type of display you desire. You mention a sub-form but I think maybe you meant a sub-report as part of a main form?

At any rate, before you go any further, the underlying constant is sound tables. Can you provide some info on those?
NauticalGent is offline   Reply With Quote
Old 05-08-2016, 06:46 AM   #3
azeeshan
Newly Registered User
 
Join Date: May 2016
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
azeeshan is on a distinguished road
Re: Append query to receive distributed result

Dear friend,

let me simplify, suppose i want distribute 15 cookies into the children of GroupA and any child can be given max 6 cookies. Thus upon distribution 2 children will have 6,6 cookies and one will have 3. thus no matter what quantities of cookies i have, it should be automatically distributed one by one 6 each and last one get rest.

I have 3 tables. One table make formA and rest of the tables make subform1 and subform2 within FormA.

FormA contains A_ID(PK) and Date() field, subform1 has 3 fields, A_ID(Fk), Group, qty(quantities of cookies) , subform2 has 4 fields A_ID(FK), Group, Qty, Child

so when i insert data into subform1, such as Group = A, Qty = 15 then upon execution of append query i automatically have 3 rows filled as follows

Group = A, Qty = 6, Child = 1

Group = A, Qty = 6, Child = 1

Group = A, Qty = 3, Child = 1

and it stops, once quantity is ended. FYI, qty will never be decimal.

regards

azeeshan is offline   Reply With Quote
Reply

Tags
access , append , query

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Conditional query to post result in a field and filter result records Jaymin Queries 1 03-07-2014 09:15 AM
Append SQL result to Table rtdc Modules & VBA 8 09-06-2012 04:13 AM
MS Access:Replacing some characters in a result column query result accessforum93 Queries 14 01-10-2011 07:20 AM
Using a combobox to receive parameters for a query samash1 Queries 11 02-15-2009 09:53 AM
how can i remove the warnings msgs result from delete and append queries? pjustin1 Queries 1 06-03-2002 08:53 AM




All times are GMT -8. The time now is 09:19 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World