Update multiple records through tab control

overkamp

Registered User.
Local time
Today, 19:06
Joined
Jun 19, 2010
Messages
14
Hi all,

I have a form that has a tab control. The tab control have 10 pages to it, each containing exactly the same controls that are bound to the same fields.

To put it in an example, I have 10 pages named page1, page2, page3, etc. Each page have exactly the same controls, which is startDate, dueDate, status, staffID, subTotal - all of which belong to the same table called "JobOrder"

I want to be able to put 10 different records into the same table all at once. But the problem is whenever I input data into page0, the same data shows up in page1, page2, etc. It is not allowing me to put different data into different pages.

Eg: I want startDate in page0 to be 19/06/10 and startDate in page1 as 01/07/10. But as soon as I put 19/06/10 into page0, the startDate in all other pages are also 19/06/10. And if I change the startDate in page1 to 01/07/10, then ALL other pages including page0 becomes 01/07/10.

Is this because all of them are on the same page?

I just need the form to be able to save multiple records at once, which is why I thought tab control would be best, but I am open to any other way that can achieve the same result.

Please help. I have been stuck on this for over 3 days...

Thanks in advance!

Overkamp
 
You don't need tabs to save multiply records.

What are you really trying to do? Create 10 new records, all the same except with different dates? or change the date of ten records?

What is the relationship between the ten records ? Are they the next ten dates?

Be a little more specific in what you are trying to do.

Have you used Append Queries and Update Queries before?
 
Thanks PNGBill.

Let me explain the background a little.

1. Client wants to make 10 orders

2. The 10 pages should hold all of the different order information, ie, the client can do up to 10 orders at a time, each with different requirements (hence 10 different records)

3. The client pays one deposit after we have the total amount of the 10 different orders. Eg: If the total of the 10 jobs is $100 (each subTotal is $10), the client can pay $50 deposit altogether. This is why I need to be able to update 10 orders at once and cannot do it one after the other because I need the total of the 10 orders before I can proceed.

As an aside, I also have a table called "tblCustomer" which records how much this client already have in terms of orders and how much deposit they have already paid.


4. The ONLY relationship between 10 records will be the "big" order number, which is Order-001 and then the 10 different records will be Order-001.00, Order-001.10, Order-001.20, Order-001.30, etc. This is so we know they all refer to the same "big" order. Everything else between each order can be different.

Unfortunately I have not used append and update queries and have never used them before. I have tried to do this as an unbounded form so I can actually input different data, but then I have problem updating them to the table using ADO recordsets.

Thanks again for helping much. Greatly appreciated.

Overkamp
 
You could handle this issue with Forms and SubForms.

Main Form is Customer and a Big Sub Form is Order.
(You have CustomerTable and OrderHeaderTable)

Then have 10 Subforms of the larger Subform. One Subform for each of the 10 SubOrder Numbers.

If the Sub Orders have only one record each then why not treat these as records of your main order rather then separate orders.
Just give your main order a field called OrderRecord and you have the large subform as a continuous form and each line has a number.

The fact that you wish to refer to these as Orders, rather then Records of an order is in the most part semantics and can be made to look how ever you wish.

You can create a form that shows the separate records as an order in themselves and you can Concatenate the number so you have Order 150 with ten records will be shown as Order 150/10, 150/11, 150/12 etc.

Amount yet to pay is as you state, all linked to the Customer.
 
Thanks again PNGBill.

I have had a thorough thought about the options and googled around for append and update queries and how to use them.

I think I will now get rid of the tabbed pages and instead make a button to save each record into a temporary suborder table upon completion. This way I can use a query to calculate the total of all suborders in the temporary table before proceeding. There is then another button which runs an append query to put them back into the main orders table.

I will have a look at the query section of this forum for guidance.

Thanks once again for all your help. This is my first post in this forum and its really good to know there's people out there who can and will help! You will probably see my post again if I am stuck on something else =)

Overkamp
 
Thanks again PNGBill.

I have had a thorough thought about the options and googled around for append and update queries and how to use them.

I think I will now get rid of the tabbed pages and instead make a button to save each record into a temporary suborder table upon completion. This way I can use a query to calculate the total of all suborders in the temporary table before proceeding. There is then another button which runs an append query to put everything from the temporary table back into the main orders table. This will also not limit me to 10 subjobs per "big" order.

I will have a look at the query section of this forum for guidance.

Thanks once again for all your help. This is my first post in this forum and its really good to know there's people out there who can and will help! You will probably see my post again if I am stuck on something else =)

Overkamp
 

Users who are viewing this thread

Back
Top Bottom