save data from main form and subform (1 Viewer)

basilyos

Registered User.
Local time
Yesterday, 22:43
Joined
Jan 13, 2014
Messages
256
hello am trying to create a sales app for my business i want to save data from the main form to a specific table and the data from the subform to another table and for each row in the subform i want to add the invoice id that is existed in themain form

here a copy of my database the form am asking with named "frm_Invoice_New"

i will really appreciate your help
 

Attachments

you should use Bound form and there is no need for "temp" invoice detail.
 
Just link them with the Link Master/Child fields in properties in the subform control.
 
what can i do to let the user save the data in both tables just by pressing save and choosing yes and if choose to close or pressing no after pressing save the data in both tables will not be saved
and also i want to prevent the invoice id to increase if the user choose not to save
 
So the InvoiceID would be your own number and not an autonumber. You would set that in the form BeforeInsert event I believe.
If you want to keep it unbound then use Insert SQL statements or recordsets.

I personally have never used unbound forms, so I am out.
 
In a relational database, the parent record must exist before the child record can be saved so that is the way bound forms are implemented. The record in the main form is saved automatically when focus moves from the main form to the subform. Then each subform record is saved when you move to the next line to add a new subform record.

If you are not going to use bound forms and the "Access way", you are far better off using a different development platform that more closely emulates your desired methods.
 
In a relational database, the parent record must exist before the child record can be saved so that is the way bound forms are implemented. The record in the main form is saved automatically when focus moves from the main form to the subform. Then each subform record is saved when you move to the next line to add a new subform record.

If you are not going to use bound forms and the "Access way", you are far better off using a different development platform that more closely emulates your desired methods.
big thanks to your reply and of course i will use it as it's desired to be used
 

Users who are viewing this thread

Back
Top Bottom