Which Method is Better or More Correct:
Setup:
Spit Database.
A wizard style form:
A table with all of the available… products (not inventory items which are products with serial numbers): (tbl_products)
A table with all of the available… locations: (tbl_locations)
Products can be assigned to locations so that they are “approved” for that location – call that table profiles (tbl_profile)
Two queries:
Qry_unassigned : This is the standard compare two tables (tbl_profile and tbl_products) and find unmatch records – where in this query takes a parameter from the form to filter by location against tbl_profile
Qry_ProfileByLo cation: this query takes a parameter from the form to filter by location against tbl_profile
Form, unbound, with a combobox using tbl_locations as the rowsource, the add-all, add-selected…. type buttons, and of course the two list boxes, a save, a reset, and cancel button. The afterupdate_eve nt of the location CBO fires the code to set the rowsource for the list boxes.
For this alpha version of the application, what I’ve been doing is taking the results from the queries and then using the additem method to populate the two list boxes.
In the past, what I’ve done is build a new table as a temporary hold where I added the returned records from each query with a yes/no box to indicate if the value should be in the left box or the right box and use this as the record source for the two boxes.
IN either case, once the save button is clicked, the code deletes all records for the selected location from tbl_profile and then adds the records for the selected products for the selected location to tbl_profile; thus, creating the new profile for the location. It then forces the fom to update so the the current loction prfile is shown
So, my question, which method of populating the listboxes is better/preferred or is there yet a better method?
Setup:
Spit Database.
A wizard style form:
A table with all of the available… products (not inventory items which are products with serial numbers): (tbl_products)
A table with all of the available… locations: (tbl_locations)
Products can be assigned to locations so that they are “approved” for that location – call that table profiles (tbl_profile)
Two queries:
Qry_unassigned : This is the standard compare two tables (tbl_profile and tbl_products) and find unmatch records – where in this query takes a parameter from the form to filter by location against tbl_profile
Qry_ProfileByLo cation: this query takes a parameter from the form to filter by location against tbl_profile
Form, unbound, with a combobox using tbl_locations as the rowsource, the add-all, add-selected…. type buttons, and of course the two list boxes, a save, a reset, and cancel button. The afterupdate_eve nt of the location CBO fires the code to set the rowsource for the list boxes.
For this alpha version of the application, what I’ve been doing is taking the results from the queries and then using the additem method to populate the two list boxes.
In the past, what I’ve done is build a new table as a temporary hold where I added the returned records from each query with a yes/no box to indicate if the value should be in the left box or the right box and use this as the record source for the two boxes.
IN either case, once the save button is clicked, the code deletes all records for the selected location from tbl_profile and then adds the records for the selected products for the selected location to tbl_profile; thus, creating the new profile for the location. It then forces the fom to update so the the current loction prfile is shown
So, my question, which method of populating the listboxes is better/preferred or is there yet a better method?
Comment