afrazier1221
New Member
- Joined
- Jul 23, 2023
- Messages
- 20
- Office Version
- 365
- Platform
- Windows
Here's what I'm doing, and what I'm trying to do.
Since my Microsoft Access skills suck, I'm creating a business database out of an Excel Workbook. For lack of a better way to describe it, I have nested data tables, and each functions interdependently with the other tables. In particular, I have four specific tables of data.
1) Customer Data — Each line of customer data begins with a customer index number, with the first record being 1 (like a key in Access).
2) Vehicle Data — Each line of vehicle data begins with a vehicle index number, with the first record being 1, followed by the customer index number to whom the vehicle belongs.
3) Estimates — Each line of estimate data begins with an estimate index number, with the first record being 1, followed by the customer index number to whom the estimate belongs, and then by the vehicle index number of that customer for which the estimate was made.
4) Invoices — Each line of invoice data begins with an invoice index number, with the first record being 1, followed by the customer index number to whom the invoice belongs, and then by the vehicle index number of that customer for which the invoice was made.
The user form contains four listboxes.
The first listbox is a list of customers in alphabetical order. When you manually click on a selection in this listbox, besides populating the relevant text boxes with the customer name, address, etc., xlookup functions are used on a separate worksheet to generate three lists, based on the customer index number, which is determined by the customer listbox selection. These xlookups use the customer index number to find vehicles in the vehicle database, estimates in the estimates database, and invoices in the invoices database that each belong to that specific customer. The other three listboxes are then populated by these three lists in turn, so that the practical result is that you select a customer from the customer list, and three other listboxes populate to show you, and make selectable, all the vehicles, active estimates, and invoices belonging to that customer.
The second listbox is for the list of vehicles. When you select a vehicle in the list, it populates the relevant text boxes with the year, make, model, etc.
When you select either an estimate or an invoice from their respective listboxes, it automatically updates the vehicle relative to the vehicle recorded in the invoice or estimate record. Say, for example, a customer has three vehicles. If I select an invoice from the invoice listbox, it uses the recorded vehicle index number to access the vehicle data, and populate the vehicle text boxes. If I select an estimate from the estimate listbox, it does the same. The relevance here is that the estimate or invoice was generated for a specific vehicle. So when I select an estimate or invoice, I want it to automatically load the related customer and vehicle information.
Up to this point, everything works like a charm. I have only one issue. I would like to have the vehicle listbox item highlighted/selected in addition to having the textboxes populated. So if I select a customer, and that customer has two vehicles, one open estimate, and three invoices, I want to be able to click on an invoice, have it populate the vehicle information boxes (which it already does), and select the relevant vehicle in the list so it shows which selection I'm on. It doesn't have to do this. What I've done works completely. But for the sake of aesthetics, how might I go about determining the correct vehicle listbox item, and then selecting it automatically via a click on a separate listbox?
I appreciate the feedback. The simpler the solution, the better.
Since my Microsoft Access skills suck, I'm creating a business database out of an Excel Workbook. For lack of a better way to describe it, I have nested data tables, and each functions interdependently with the other tables. In particular, I have four specific tables of data.
1) Customer Data — Each line of customer data begins with a customer index number, with the first record being 1 (like a key in Access).
2) Vehicle Data — Each line of vehicle data begins with a vehicle index number, with the first record being 1, followed by the customer index number to whom the vehicle belongs.
3) Estimates — Each line of estimate data begins with an estimate index number, with the first record being 1, followed by the customer index number to whom the estimate belongs, and then by the vehicle index number of that customer for which the estimate was made.
4) Invoices — Each line of invoice data begins with an invoice index number, with the first record being 1, followed by the customer index number to whom the invoice belongs, and then by the vehicle index number of that customer for which the invoice was made.
The user form contains four listboxes.
The first listbox is a list of customers in alphabetical order. When you manually click on a selection in this listbox, besides populating the relevant text boxes with the customer name, address, etc., xlookup functions are used on a separate worksheet to generate three lists, based on the customer index number, which is determined by the customer listbox selection. These xlookups use the customer index number to find vehicles in the vehicle database, estimates in the estimates database, and invoices in the invoices database that each belong to that specific customer. The other three listboxes are then populated by these three lists in turn, so that the practical result is that you select a customer from the customer list, and three other listboxes populate to show you, and make selectable, all the vehicles, active estimates, and invoices belonging to that customer.
The second listbox is for the list of vehicles. When you select a vehicle in the list, it populates the relevant text boxes with the year, make, model, etc.
When you select either an estimate or an invoice from their respective listboxes, it automatically updates the vehicle relative to the vehicle recorded in the invoice or estimate record. Say, for example, a customer has three vehicles. If I select an invoice from the invoice listbox, it uses the recorded vehicle index number to access the vehicle data, and populate the vehicle text boxes. If I select an estimate from the estimate listbox, it does the same. The relevance here is that the estimate or invoice was generated for a specific vehicle. So when I select an estimate or invoice, I want it to automatically load the related customer and vehicle information.
Up to this point, everything works like a charm. I have only one issue. I would like to have the vehicle listbox item highlighted/selected in addition to having the textboxes populated. So if I select a customer, and that customer has two vehicles, one open estimate, and three invoices, I want to be able to click on an invoice, have it populate the vehicle information boxes (which it already does), and select the relevant vehicle in the list so it shows which selection I'm on. It doesn't have to do this. What I've done works completely. But for the sake of aesthetics, how might I go about determining the correct vehicle listbox item, and then selecting it automatically via a click on a separate listbox?
I appreciate the feedback. The simpler the solution, the better.