tnguyen315
MIS
Please help, I'm very appreciated...
Thank you very much.
I have a main form with several sub forms, each sub form on each tab. The main form has a button "Add New". So when hitting the "Add New" button to add a new record, then the second sub form should be automatical inserted the most current records (one to many relationship) from the last inspection into the table and show on the sub form on the second tab.
I had created the query for the most current records with results:
qryMostCurrentNonViolation
Estab. No Inspection No Date Inspection NonVio No Documentation repeat
20922 218959 5/10/2011 1 test 1 0
20922 218959 5/10/2011 2 test 2 2
20922 218959 5/10/2011 3 test 3 1
26906 218959 5/14/2011 1 test 1 0
26906 218959 5/14/2011 2 test 2 3
26906 218959 5/14/2011 3 test 3 1
26906 218959 5/14/2011 4 test 4 2
23198 218867 10/11/2011 1 test 1 1
and so on...
So for instance, on main form I enter establishno = 26906 then enter the rest of data, then click on the button "Add New", then the new Inspection No will be generated by the system with the new Inspection = 222222 (tblInspection : on the main form)
The results on my sub form should be:
tblNonViolation (primary keys: inspectionNo and VioNo) (repeat = repeat.value + 1)
InspectionNo VioNo Documentation Repeat
222222 1 test 1 1
222222 2 test 2 4
222222 3 test 3 2
222222 4 test 4 3
Please help,
again, thank you very much.
Twee
Thank you very much.
I have a main form with several sub forms, each sub form on each tab. The main form has a button "Add New". So when hitting the "Add New" button to add a new record, then the second sub form should be automatical inserted the most current records (one to many relationship) from the last inspection into the table and show on the sub form on the second tab.
I had created the query for the most current records with results:
qryMostCurrentNonViolation
Estab. No Inspection No Date Inspection NonVio No Documentation repeat
20922 218959 5/10/2011 1 test 1 0
20922 218959 5/10/2011 2 test 2 2
20922 218959 5/10/2011 3 test 3 1
26906 218959 5/14/2011 1 test 1 0
26906 218959 5/14/2011 2 test 2 3
26906 218959 5/14/2011 3 test 3 1
26906 218959 5/14/2011 4 test 4 2
23198 218867 10/11/2011 1 test 1 1
and so on...
So for instance, on main form I enter establishno = 26906 then enter the rest of data, then click on the button "Add New", then the new Inspection No will be generated by the system with the new Inspection = 222222 (tblInspection : on the main form)
The results on my sub form should be:
tblNonViolation (primary keys: inspectionNo and VioNo) (repeat = repeat.value + 1)
InspectionNo VioNo Documentation Repeat
222222 1 test 1 1
222222 2 test 2 4
222222 3 test 3 2
222222 4 test 4 3
Please help,
again, thank you very much.
Twee