Hi,
I have a database with four tables and the following relationships:
- Patients - Op Notes: One to many
- Op Notes - Histology: One to One
- Op notes - Complications: One to Many
Although it is not recommended there are a few fields that i wanted to be in all three tables: Op Notes, Histology, and Complications
Among other forms that I use to update the tables i have "Histology" and "Complication" forms. I have written a simple code to auto populate the fields in the form Histology and Complication with the data from the table Op Notes that i have already recorded. The firing event is After update of a form field "Operation ID". When i first created the forms they were both working perfectly well. However suddenly the form “Histology” does not work as expected: When I enter a new record the required fields will not autopopulate with the code. If I close the form and then reopen it to a record and then I update the field ”Operation ID” then the code works and populate the fields. Of note the two forms are very similar with the exact same properties and the “Complication” form still works very well as expected. The problem persists when I change the property “Data Entry” to yes or no. The code that I use looks like that:
Option Compare Database
Private Sub IDOPERATION_AfterUpdate()
Me.AGE.Value = Me.AGE_Operation_Note.Value
Me.CONSULTANT = Value = Me.Cons.Value
Me.Procedure.Value = Me.Procedure_Operation_Note.Value
Me.BreastProcedure.Value = Me.Breastprocedure_Operation_Note.Value
Me.operationcategory.Value = Me.operationcategory_Operation_Note.Value
Me.AxillaryProcedure.Value = Me.AxillaryProcedure_Operation_Note.Value
Me.Laterality.Value = Me.Laterality_Operation_Note.Value
Me.Presentation_Hist.Value = Me.Presentation.Value
Me.NeoAdjChemoTx.Value = Me.neoadjuvantchemotherapy.Value
Me.NeoAdjETx.Value = Me.neoadjuvantendocrine.Value
Me.CavityShavings.Value = Me.CavityShavings_Operation_Note.Value
End Sub
Do you have any idea why this may be happening?
Many thanks, for your time and expertise!