Solved

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

Posted on 2012-04-13
3
287 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

705 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

20 Experts available now in Live!

Get 1:1 Help Now