Main form and subform to create additional records on two other tables

grahamiwa

New Member
Joined
Mar 14, 2011
Messages
30
I am sending this from my phone so I am unable to post any screenshots etc. sorry.

I am trying to create an Inventory and sales database.
I have loosly used the Microsoft Northwind template as a guide.
I have a Sales form with a Sales Detail sub form.
The sales form creates a new record on the sales table (Fields - Sale ID, Customer ID, Sales Date) and the sub form creates a new record on the Sales Detail table (Fields - Sales Detail ID, Sale ID, Product ID, Quantity, Unit Price). This works fine.

I also need the Sales Date, Product ID and Quantity entered in the Inventory Transaction Table (Fields - Inventory Transaction ID, Transaction Date, Transaction Type ID, Product ID, Quantity).

I can set the default value for the Transaction Type ID to that required for a sale in the Inventory Transaction Table but I don't know how to get the other data into the table.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Create an Append query that will write the values from the form when that form is open. Once you have it working, use an event to run that query. The event could be a button click that you're using to save the form. Not knowing the rest of the process and design means I can't say for sure which events you could use. Make sure you test append operations on copies of tables before implementing the process. Watch out for duplicate entries in case an event can fire more than once for the same record, such as a button click. Putting unique indexes on the table field can prevent it, but you might want to customize the error message that Access will otherwise present.
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,923
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top