None of my brand new Access 2003 books have any examples of the simple task I'd like to perform, so I'll put my faith in you guys...
Here's a screenshot with relations and all:
I have a subform displaying people connected to a case. These people are all linked via a lookup table. When displaying the case main form I get the subform by using this query:
Problem 1:
Below the subform (in the main form) I've managed to add a combobox displaying all the people records. I'd like the button "Add to Case" to insert a row in the lookup table "tbl_Personal_Info" linking the current case with the selected person, if there isn't already such a record (avoiding a key error).
Problem 2:
I'd like the "Add Person" button to open the form "frm_Personal_Info_Def" with a new record, and if the record is saved (perhaps with a button in the form) then the same link between the case and the person should be formed. The subform should also be updated to show the newly added person.
This seems like a pretty trivial problem, but after spending 20 hours testing different solutions that hasn't worked, I'm beginning to lose my temper.
Thanks in advance!
/Jonas Hummelstrand
Here's a screenshot with relations and all:
I have a subform displaying people connected to a case. These people are all linked via a lookup table. When displaying the case main form I get the subform by using this query:
Code:
SELECT tbl_Case_Type_Def.*
FROM tbl_Case_Type INNER JOIN tbl_Case_Type_Def ON tbl_Case_Type.Case_Type=tbl_Case_Type_Def.ID_Case_Type_Def
WHERE tbl_Case_Type.Case_ID=tbl_Case.ID_Case;
Problem 1:
Below the subform (in the main form) I've managed to add a combobox displaying all the people records. I'd like the button "Add to Case" to insert a row in the lookup table "tbl_Personal_Info" linking the current case with the selected person, if there isn't already such a record (avoiding a key error).
Problem 2:
I'd like the "Add Person" button to open the form "frm_Personal_Info_Def" with a new record, and if the record is saved (perhaps with a button in the form) then the same link between the case and the person should be formed. The subform should also be updated to show the newly added person.
This seems like a pretty trivial problem, but after spending 20 hours testing different solutions that hasn't worked, I'm beginning to lose my temper.
Thanks in advance!
/Jonas Hummelstrand