I am seeking some advice on how best to set up some cascading combo boxes (or if this is exactly what I need to start with). (I have read the link to Cascading combo boxes examples but my needs go beyond those examples).
The scenario -
I have a form used for user entry which I want to guide users to keep standardised naming as best as possible.
I have a facility type (Hospital, Nursing home, Community, GP and other) of which I have lists for the first 3 categories. The last 2 categories I want users to be able to select from a previously created entry OR free text a new entry.
My current setup is that I have all the Facility Information in the one table -
tblFacilities with the fields [Facility Type] and [Facility Name] plus some other linked information.
I then have 2 combo boxes cmbCompletionLocation which has the 5 facility types and a cmbCompletionFacility which has the rowsource set to a query:
SELECT tblFacilities.ID, tblFacilities.[Facility Name], tblFacilities.[Facility Type] FROM tblFacilities WHERE (((tblFacilities.[Facility Type])=[Forms]![frmlDocumentLog]![cmbCompletionLocation])) ORDER BY tblFacilities.[Facility Name];
The cmbCompletionLocation has an AfterUpdate event to requery the cmbCompletionFacility.
This seems to work well as in when they select "Hospital" it filters out the second combo box to only list the hospitals, which is the designed behaviour.
But when it comes to having the ability for users to enter free text if they have the last 2 options (GP and other) the combo box is locked as it is "limited to list" due to the way it is set up with bound columns.
Ultimately I would like that if a user enters in a new Facility Name in the cmbCompletionFacility it both saves that to the current record (in the table tblDocumentLog) and creates that new record in the tblFacilities table so it can be used in the future.
Am I going about this the wrong way? Is what I am hoping to achieve too complex? Is my database design set up the best way to do this? I originally had the different facility types in their own tables but this created a level of complexity I was not comfortable with.
The scenario -
I have a form used for user entry which I want to guide users to keep standardised naming as best as possible.
I have a facility type (Hospital, Nursing home, Community, GP and other) of which I have lists for the first 3 categories. The last 2 categories I want users to be able to select from a previously created entry OR free text a new entry.
My current setup is that I have all the Facility Information in the one table -
tblFacilities with the fields [Facility Type] and [Facility Name] plus some other linked information.
I then have 2 combo boxes cmbCompletionLocation which has the 5 facility types and a cmbCompletionFacility which has the rowsource set to a query:
SELECT tblFacilities.ID, tblFacilities.[Facility Name], tblFacilities.[Facility Type] FROM tblFacilities WHERE (((tblFacilities.[Facility Type])=[Forms]![frmlDocumentLog]![cmbCompletionLocation])) ORDER BY tblFacilities.[Facility Name];
The cmbCompletionLocation has an AfterUpdate event to requery the cmbCompletionFacility.
This seems to work well as in when they select "Hospital" it filters out the second combo box to only list the hospitals, which is the designed behaviour.
But when it comes to having the ability for users to enter free text if they have the last 2 options (GP and other) the combo box is locked as it is "limited to list" due to the way it is set up with bound columns.
Ultimately I would like that if a user enters in a new Facility Name in the cmbCompletionFacility it both saves that to the current record (in the table tblDocumentLog) and creates that new record in the tblFacilities table so it can be used in the future.
Am I going about this the wrong way? Is what I am hoping to achieve too complex? Is my database design set up the best way to do this? I originally had the different facility types in their own tables but this created a level of complexity I was not comfortable with.