Button to copy data from one record to the next (1 Viewer)

Metric

Registered User.
Local time
Today, 02:39
Joined
Sep 14, 2019
Messages
26
Hello All,

I am in the process of creating a database to cover the purchases of various people within a group. I have two tables - one for orders (vendor, date, order number, person who ordered, some shipping info) and one for the items and their costs ordered within each order - the tables are related by the order number. I have a form to enter the order info with a subform for the items. So far so good.

The problem is that sometimes a single order is for two people - ie. Bob and Joe both needed something from Vendor X, so they ordered together to save on the shipping, but now some of the items in the order should be charged to Bob and some to Joe. I recognize that this must require two separate entries in the order table, but much of the order info is actually identical and things like long order numbers are tedious to re-enter correctly. Is there code for a button that would create a new record and duplicate some of the order info if desired? The only references I can find online are options to duplicate fields every single time you create a new record, which doesn't make sense here. I tried just duplicating the whole record but that led to mistakes when important fields were not changed.

Thanks for any insight anyone has!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:39
Joined
Aug 30, 2003
Messages
36,118
Would it make sense to have a single order record with a field in the items table for who to charge it to?
 

Metric

Registered User.
Local time
Today, 02:39
Joined
Sep 14, 2019
Messages
26
Hmmm. Sorry, I'm not sure what you mean.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:39
Joined
Aug 30, 2003
Messages
36,118
I mean if there were 5 different items in the items table, each could be charged to a different person. This wouldn't work if one of the items had a quantity greater than 1 and within that item some were charged to one person and some to another. There's this which would copy the whole order:

 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 09:39
Joined
Jul 9, 2003
Messages
16,245
The problem is that sometimes a single order is for two people - ie. Bob and Joe both needed something from Vendor X,

I wouldn't entertain it... Let me explain.... I can go on Amazon and make purchase, but there's no way I can make a purchase for two people. I am the person responsible and if I'm buying something for myself and another, then I sort it out with the "another". I don't expect Amazon to sort it out. This is how most things like this are done. I think to try and build it into your database is a mistake.
 

Metric

Registered User.
Local time
Today, 02:39
Joined
Sep 14, 2019
Messages
26
I mean if there were 5 different items in the items table, each could be charged to a different person. This wouldn't work if one of the items had a quantity greater than 1 and within that item some were charged to one person and some to another. There's this which would copy the whole order:


Unfortunately I don't think copying the whole order would work. I thought about adding a column in the items table but annoyingly there are sometimes orders with, say, 20 items, and most or all are for one person, so having to add that in when you're filling in items would be a bit time consuming.
 

Metric

Registered User.
Local time
Today, 02:39
Joined
Sep 14, 2019
Messages
26
I wouldn't entertain it... Let me explain.... I can go on Amazon and make purchase, but there's no way I can make a purchase for two people. I am the person responsible and if I'm buying something for myself and another, then I sort it out with the "another". I don't expect Amazon to sort it out. This is how most things like this are done. I think to try and build it into your database is a mistake.
Yeah I understand where you're coming from and I definitely respect the opinion. Part of the problem is I'm moving an old Excel spreadsheet system over to this and it's already been done that way in the past, with comments made on the spreadsheet to that effect. If possible, I'd like to retain that information.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:39
Joined
Aug 30, 2003
Messages
36,118
The word "control" would be the name of the textbox on your form. They mention a button, but I'd lean towards the after update event of that textbox.
 

Users who are viewing this thread

Top Bottom