G
Guest
Hi,
Here are my tables and some relevant fields:
- "HP" containing "MRN" (key) and "ID"
- "Med" containing "MedID" (key), "MRN" and "loop" (a text)
- "Research" containing "ID" (key) and "loop"
"HP" and "Med" have a one to many relationship. For complicated reasons, I
have not related Research with any other tables.
I have a form ("HPform") with its subform ("Medsubform" in datasheet view)
related by MRN.
This is what I would like to do:
1. Write a code in "loop" control of Medsubform so that when one puts data
in the "loop" control it looks up the related "ID" in the parent "HPform" and
checks to see if this record exists in the "Research" table.
2. If it exists, I want it to populate the "loop" field in the "Research"
table with the value in the "loop" control in the "Medsubform".
3. If it does not exists, I want it to create a new record in the
"Research" table with the value of "ID" in the "HPform" and then populate the
"loop" field.
I really appreciate your time in helping me with this.
Thank you,
Here are my tables and some relevant fields:
- "HP" containing "MRN" (key) and "ID"
- "Med" containing "MedID" (key), "MRN" and "loop" (a text)
- "Research" containing "ID" (key) and "loop"
"HP" and "Med" have a one to many relationship. For complicated reasons, I
have not related Research with any other tables.
I have a form ("HPform") with its subform ("Medsubform" in datasheet view)
related by MRN.
This is what I would like to do:
1. Write a code in "loop" control of Medsubform so that when one puts data
in the "loop" control it looks up the related "ID" in the parent "HPform" and
checks to see if this record exists in the "Research" table.
2. If it exists, I want it to populate the "loop" field in the "Research"
table with the value in the "loop" control in the "Medsubform".
3. If it does not exists, I want it to create a new record in the
"Research" table with the value of "ID" in the "HPform" and then populate the
"loop" field.
I really appreciate your time in helping me with this.
Thank you,