Solved

Pass multiple fields from one form to the last record of another query Form

Posted on 2012-04-13
3
288 Views
Last Modified: 2012-04-19
I have an access db with 2 tables NoSlotItem and SlotAvailable.
I have 2 forms "NoSlotItem" and "SlotAvailableForm"
I have a query SlotAvailableQuery which is based on SlotAvailable for a Selected "Slot".
The "NoSlotItem" is form made from NoSlotItem table and the "SlotAvailableForm" is made from SlotAvailableQuery.

on the "NoSlotItem" form I have a button "Run Slot" and has an On click event. When I press the button, I basically open form
"SlotAvailableForm" and pass multiple values from "NoSlotItem" form to "SlotAvailableForm" form.

I'm able to pass the value from "NoSlotItem" form to "SlotAvailableForm" form but I want the values I pass from
"NoSlotItem" form to "SlotAvailableForm" form to go to the last record of the "SlotAvailableForm" form and the Start date to get populated from
the End date of the previous record for the selected Slot.
I have attached my db so you can take a look at it.

For example in Table SlotAvaliable, I have the following record for Slot 1
 
Slot      Item      Qty      StartDate       EndDate        NextAvaDate      Ordno      Run         
1      Wire      10       4/13/2012   4/15/2012  4/16/2012      1234          1              
1      Cable      100     4/15/2012   4/16/2012  4/16/2012      5678          2            


Now from form "NoSlotItem" , I want to to assign the item "Paper " to Slot 1, I put 1 on Slot on "NoSlotItem" form and click
on Run slot button, when the SlotAvailableForm opens, I want it to look like this and the Paper goes to the last record and gets the
Start date from the End date of the previous record which is item "Cable"
so I want form SlotAvailableForm" to look like this

Slot   Item   Qty  Order   Start Date     End Date       Run
1       Wire    10   1234     4/13/2012    4/15/2012        1
1       Cable  100  5678     4/15/2012    4/16/2012        2
1       Paper   133 1111     4/16/2012                            3

So the user will put the Run as 3 and the should go as the 3rd record and it should populate the
Start date as 4/16/2012 from the previous record End date  "Cable", so this can be saved back to SlotAvailable table.

I have another part I want to do here, but I think I should post it as another question to be fair.I will do that once, I
have a solution for this.

As such it just shows and one record and over writes
Slot   Item   Qty  Order   Start Date     End Date       Run
1       Paper   133 1111                            

Please let me know, how I can do this.
Test.mdb
0
Comment
Question by:Sivasan
3 Comments
 
LVL 26

Accepted Solution

by:
Nick67 earned 250 total points
ID: 37845016
Let's maybe back up a step or two.

I am not really able to make sense of your question or your database.
Both of these tables have most, if not all, of the same fields--which throws up a big red flag!
And there are no relationships present

Building the interfaces before the data design is worked out is a sure recipe for grief.
Have a look here
http://www.phlonx.com/resources/nf3/
and work through that tutorial.

Then revisit your sample and the question.
You have items, you have slots -- but you also have orders and maybe other things too
You HAVE to start with normalized tables to get anywhere useful.

:)
0
 
LVL 5

Assisted Solution

by:ggzfab
ggzfab earned 250 total points
ID: 37847183
I concur with Nick67.Start with normalizing your tables first.
When you have to "move" records there's something wrong with the design.
In this case I would expect a table with a property "SlotAvailable" with the value "Yes/No" or a mastertable "SlotItem" with related "SlotItemDetails" that are added when a slotitem is used.
0
 

Author Closing Comment

by:Sivasan
ID: 37868489
Thank you guys, I figured out.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now