Solved

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

Posted on 2012-04-13
3
292 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

688 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