Topic: Need help with One To Many relationship database.

Hello. I am making a program for my own use that has multiple parties, and each party will have multiple bills related to him. each bill will have multiple records, having quantity and weight details. My question is, how do I add and save a bill?

I can use forms to add records, and add parties., but this involves simultaneously creating a new BILL and simultaneously saving multiple records in that particular bill. When do I save the voucher, and when do I save the individual transactions in the bill?

Do I add a small form to save an empty voucher to the BILLS table, then create a new form to add RECORDS to the records table, and link to to the VOUCHERS table?

Re: Need help with One To Many relationship database.

The way that standard MVD works, if you enter 'bill' details and immediately continue to enter 'record' details relating to that bill, MVD will automatically save your 'bill' details (the logic being that the 'bill' must exist before any related 'record' details can be created). 
This still allows you the option to enter 'bill' details and manually 'save' them (for example, because you want to create a bill with no records).
Have a look at the attachment as one possible approach.
Derek.

Post's attachments

Attachment icon dhekabai.zip 439.96 kb, 92 downloads since 2023-06-14 

Re: Need help with One To Many relationship database.

derek wrote:

The way that standard MVD works, if you enter 'bill' details and immediately continue to enter 'record' details relating to that bill, MVD will automatically save your 'bill' details (the logic being that the 'bill' must exist before any related 'record' details can be created). 
This still allows you the option to enter 'bill' details and manually 'save' them (for example, because you want to create a bill with no records).
Have a look at the attachment as one possible approach.
Derek.


Thank you for your response! I figured it out while checking the ready made invoice example database, and your response makes it clearer.
I have one additional question, can you show me how to add a newline to a Message Box?

I want to show a message like:

Hello
World!

in two separate lines.

Re: Need help with One To Many relationship database.

Hi,
Try it like this (see the attachment). 
Click on the 'delete' button to see the message split over two lines.
Derek.

Post's attachments

Attachment icon message box two lines.zip 439.05 kb, 93 downloads since 2023-06-15 

Re: Need help with One To Many relationship database.

derek wrote:

Hi,
Try it like this (see the attachment). 
Click on the 'delete' button to see the message split over two lines.
Derek.


That works perfectly, thank you!