I am quite new to Access and thus I thought I might just ask before getting into too complex solutions...
What I want to do is the following:
- I would like to create a database for all patients undergoing a specific procedure in our clinic, which requires the implantation and explantation of a device
Thus, I created a table for patient-related data (ID, Name, Date of birth, etc.) and two tables regarding implantation and explantation data (Date, time, patientID, surgeon, etc.). I could have thrown all data in one table, however, I would prefer to keep that separated, to keep the structure and data clearer. Does that make sense?
I created a query, that links all data by patientID
- I created a form, that displays the query data. I would want to use that, to populate the tables.
The problem thereby is, that I cannot add data to the implantation / explantation fields of the form, since there is no correlating patientID given there. Thus, I created some VBA Code, to automatically fill in the patientID into the other tables, once the patientname has been entered.
var1 = Form_test2.internalPatientID.Value
StrSQL = "INSERT INTO ImplantationsDatenT PatientenID ('" & var1 & "' );"
DoCmd.SetWarnings False
DoCmd.RunSQL StrSQL
DoCmd.SetWarnings True
That works so far, however, the data is not directly updated in the form, meaning, I have to switch to another dataset and back and then I can enter the values for implantation time etc, but not earlier.
My Questions are:
- Does it make sense, to split the data, even if I always have data for all tables?
- Is there an easier way to fill in the data than described?
- If not, how can I "update" the query from VBA, to allow direct filling of all fields?
Thank you for your time and for reading all this, I hope I made my problem understandable...