Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

610 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