create multiple records with one form

Daluwi

New member
Local time
Today, 10:42
Joined
Feb 23, 2022
Messages
4
Hello,

I want to charge multiple records in the same table with a diferent field, example.

i have my form with the same information up but with diferent "codigo de parada" and "tiempo(min)"
like the image below

1645643112590.png


But when i save the record not charge the information of above only charge the subform information.
Like the image below
1645643398697.png


Thaknsss and wait for your help
 
Why are you saving main form info into subform table? Looks like it should be in a 'parent' table and subform data in a related 'child' table.
 
Because i need a record for each value register in the subforms, all with the same information as above, something like that:

id x y cod time
1 house rice 300 10
2 house rice 705 12
3 house rice 712 20

where only record the value X and Y one time for each cod charge in the sub form
 
Hi. Welcome to AWF!

Can you show us the design view of your query too? Thanks.
 
Oh sure.

This is mi subform



1645645166967.png

and this is mi main form

1645645209836.png

and i have a query that now i dont use, because is the same result that a subform
1645645327143.png





thanksss
 
Because i need a record for each value register in the subforms, all with the same information as above, something like that:

id x y cod time
1 house rice 300 10
2 house rice 705 12
3 house rice 712 20

where only record the value X and Y one time for each cod charge in the sub form
That's what queries are for - to JOIN related tables. You appear to be duplicating too much data. This is counter to principles of relational database.

With current data structure, should not use form/subform, use a single form and use code to repeat the common data for each record. One way is to set DefaultValue property of each control when user inputs a value. That value will then carry forward for each new record until user enters another value.

The optimal solution is to correctly design relational database.
 

Users who are viewing this thread

Back
Top Bottom