Hello to all, i have a main form "PATIENT" and a subform "VISIT" into the "PATIENT". In the "PATIENT" i have a button and i want when i click it, to add a new record in both forms.
Thanks John.
I am assuming that the tables in your patient and visit forms are linked somehow PATIENT<->VISIT 1:M relationship?
If that is the case then you need to bear in mind the following - it is easy to do so these pointers should help you.
1) The record will need to be entered into the parent table PATIENT first - this may seem obvious, but Access is a pain at reporting errors at times.
2) Once the record has been added to your main form then you need to select it somehow - look at RowSource on your main for,
3) Once the record is displayed then you can get your PK from the main form - this will be used as the base for the sub form presumably. Once you have this value then it is a simply case to add the record to your secondary table and refresh the sub form.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.