Show New Record in Subform, after new ComboBox Selection

LtWorf33

New member
Local time
Today, 17:34
Joined
May 14, 2020
Messages
13
Hi all. I am working on a Form [frm_FacilitySelect] that has a ComboBox. The form has a TabControl, each tab showing a different subform. Each subform displays different details regarding the facility selected in the ComboBox. Is it possible to change the contents of the subform based on the ComboBox selection? Can I choose a different facility in the ComboBox, press a button, and have the subforms change to the new selection?
 
Hi. It depends. Is the Combobox bound or unbound? Are you using it to navigate the current record to the selected item? Are your subforms linked to the main form?
 
Currently, The ComboBox says 'unbound'. I can give you a quick synopsis of what I have and what I am trying to achieve to help give you context of how I am trying to use this.

- I have the following tables:
tbl_FacilityInfo: Stores basic information about the facility (address, phone number, etc)
tbl_EmergencyInfo: Stores emergency information about the facility (local fire and police depts, etc)
tbl_PropertyInfo: Stores property details about the facility (acreage, township, city office contacts, etc)

Each one of the tables has a full list of the facilities as the PK (field called facility_id). They are 3 letter abbreviation codes by city. (LVE = Lousiville). All the tables are linked by the facility_id.

My goal is to have a main form (frm_FacilitySelect) that has a ComboBox and a select button, with a TabControl below. The ComboBox contains the list of facility_id's. The TabControl has a tab for each of the tables listed above (Basic Info tab, Emergency Contact tab, Property Info tab). When a facility is selected from the ComboBox and the button is pressed, I would like each tab to change to display the information pertaining to the selected facility. Let me know if I am thinking about the wrong if there is a more concise way of achieving this.
 
Currently, The ComboBox says 'unbound'. I can give you a quick synopsis of what I have and what I am trying to achieve to help give you context of how I am trying to use this.

- I have the following tables:
tbl_FacilityInfo: Stores basic information about the facility (address, phone number, etc)
tbl_EmergencyInfo: Stores emergency information about the facility (local fire and police depts, etc)
tbl_PropertyInfo: Stores property details about the facility (acreage, township, city office contacts, etc)

Each one of the tables has a full list of the facilities as the PK (field called facility_id). They are 3 letter abbreviation codes by city. (LVE = Lousiville). All the tables are linked by the facility_id.

My goal is to have a main form (frm_FacilitySelect) that has a ComboBox and a select button, with a TabControl below. The ComboBox contains the list of facility_id's. The TabControl has a tab for each of the tables listed above (Basic Info tab, Emergency Contact tab, Property Info tab). When a facility is selected from the ComboBox and the button is pressed, I would like each tab to change to display the information pertaining to the selected facility. Let me know if I am thinking about the wrong if there is a more concise way of achieving this.
Try the following:
  1. Create a main form based on your facility info table
  2. Create a subform based on your emergency and property info tables
  3. Link the subforms to the main form using the facility_id
  4. Navigate through the main form to view different facilities and make sure the subforms change data based on the current facility displayed on the main form
  5. Add an unbound Combobox on the main form using the Wizard and select the third option
  6. Now, use the combobox to select a different facility
  7. Make sure the main form changes to the selected facility
  8. Check if the subforms also changed the data to match the selected facility
 

Users who are viewing this thread

Back
Top Bottom