?
Solved

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

Posted on 2012-04-13
3
Medium Priority
?
293 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 500 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 500 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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