Hi. This is my first time ever using MS Access, and I'm a little stuck on something. I'm creating a database in MS Access 97 which keeps track of rail car incidents. The main menu of my database is a form consisting of combo boxes and a command button. The command button takes you to a data entry form bound to a table called tbl_incidents. This form allows the user to add or edit data in the Incidents table.
I also want the user to be able to search the incidents based on user-specified criteria. This is where the combo boxes come to use. I have 2 combo boxes, one each for a specific field in the Incidents table: Date and System. Instead of binding the combo boxes to their respective fields in tbl_incidents however, I created seperate tables called tbl_date and tbl_system for the combo boxes. These tables are indexed with no duplicates, this way each value is only displayed ONCE in the combo box. I cannot index the fields in tbl_incidents with no duplicates because tbl_incidents is used as a log for all problems relating to the rail cars and each incident needs to be recorded with its corresponding date and system. So for instance, I may have one entry:
[Date] 6/2/11; [System] Brake; [Incident] Brake fault on car 1555
Then I may have a following entry with duplicate dates and systems, but with a different incident:
[Date] 6/2/11; [System] Brake; [Incident] Brake pipe on car 1234 frozen
So, I need to allow duplicates in tbl_incidents. For this reason, I cannot bind the combo boxes to that table. Incidents with the rail cars happen daily and need to be recorded. The problem is the data entered into the text boxes on the data entry form get saved in tbl_incidents but not in tbl_date or tbl_system. I need the new values to also be added to those two tables in order to display them in the combo boxes. For example, if the user enters
[Date] 6/5/11; [System] Car; [Incident] xxxxxxxxxxxxxxx
I want "6/5/11" to be added to tbl_date and "Car" to be added to tbl_system. But if, for instance, the user enters a value into a field that already exists in the table, I don't want a duplicate of that value to be added to the table.
So my question is how do I store data entered into a text box in a table not bound to the form, and how can I do it so that there are no duplicates displayed in the combo box?
I also want the user to be able to search the incidents based on user-specified criteria. This is where the combo boxes come to use. I have 2 combo boxes, one each for a specific field in the Incidents table: Date and System. Instead of binding the combo boxes to their respective fields in tbl_incidents however, I created seperate tables called tbl_date and tbl_system for the combo boxes. These tables are indexed with no duplicates, this way each value is only displayed ONCE in the combo box. I cannot index the fields in tbl_incidents with no duplicates because tbl_incidents is used as a log for all problems relating to the rail cars and each incident needs to be recorded with its corresponding date and system. So for instance, I may have one entry:
[Date] 6/2/11; [System] Brake; [Incident] Brake fault on car 1555
Then I may have a following entry with duplicate dates and systems, but with a different incident:
[Date] 6/2/11; [System] Brake; [Incident] Brake pipe on car 1234 frozen
So, I need to allow duplicates in tbl_incidents. For this reason, I cannot bind the combo boxes to that table. Incidents with the rail cars happen daily and need to be recorded. The problem is the data entered into the text boxes on the data entry form get saved in tbl_incidents but not in tbl_date or tbl_system. I need the new values to also be added to those two tables in order to display them in the combo boxes. For example, if the user enters
[Date] 6/5/11; [System] Car; [Incident] xxxxxxxxxxxxxxx
I want "6/5/11" to be added to tbl_date and "Car" to be added to tbl_system. But if, for instance, the user enters a value into a field that already exists in the table, I don't want a duplicate of that value to be added to the table.
So my question is how do I store data entered into a text box in a table not bound to the form, and how can I do it so that there are no duplicates displayed in the combo box?
Last edited: