Never Hide
Registered User.
- Local time
- Today, 16:30
- Joined
- Dec 22, 2011
- Messages
- 96
Hello guys,
I have a database of this form:
tblDestination(id,Destination)
tblDistance(Destination_id,Distace_From_Home)
Destination_id is a FK that references the id of the "tblDestination".
I have created an unbound form, for this db, called "frmStops" and in this form I have a combo box called "cbDestination", a text box called "tbStopCustomers", a list box called "lbStops" and an "Add" button. In the form there are also some more text boxes "tbStop1Cost", "tbStop2Cost" and so on, and a text box "tbFinalCost". This form is going to be used to calculate the cost of a route traveled by an emploee in our company that goes to customers for service purposes.
"cbDestination" is the city at which the customer is.
"tbStopCustomers" is the number of the customers that will be served in that city.
What I'd like to do with this form is:
Select the Destination from "cbDestination", input the number of customers in the "tbStopCustomers", press the "Add" button and have those options added in the List Box "lbStops". Also there would be a 3rd column in the list box that will display the "Distance_From_Home". Then, after the 1st selection is added to the list box, you can select another city fom the "cbDestination" and repeat the same proces for as many stops as necessary. So after adding 3 stops, the list box would look something like this:
1 more thing: When you press the "Add" button I want the "tbStop1Cost" to populate with the cost for Stop1(I have the code for the culculations needed) based on the values "Distance_From_Home" and "StopCustomers" from the 1st entry in the lst box. Then the equivalent thing for Stop2,Stop3 and so on...
I have never worked with List Boxes before so please be as thorough as you can be
Thank you everyone in advance
I have a database of this form:
tblDestination(id,Destination)
tblDistance(Destination_id,Distace_From_Home)
Destination_id is a FK that references the id of the "tblDestination".
I have created an unbound form, for this db, called "frmStops" and in this form I have a combo box called "cbDestination", a text box called "tbStopCustomers", a list box called "lbStops" and an "Add" button. In the form there are also some more text boxes "tbStop1Cost", "tbStop2Cost" and so on, and a text box "tbFinalCost". This form is going to be used to calculate the cost of a route traveled by an emploee in our company that goes to customers for service purposes.
"cbDestination" is the city at which the customer is.
"tbStopCustomers" is the number of the customers that will be served in that city.
What I'd like to do with this form is:
Select the Destination from "cbDestination", input the number of customers in the "tbStopCustomers", press the "Add" button and have those options added in the List Box "lbStops". Also there would be a 3rd column in the list box that will display the "Distance_From_Home". Then, after the 1st selection is added to the list box, you can select another city fom the "cbDestination" and repeat the same proces for as many stops as necessary. So after adding 3 stops, the list box would look something like this:
Code:
Destination | StopCustomers | Distance_From_Home
--------------------------------------------------------
Stop1 2 13
Stop2 1 25
Stop3 4 60
I have never worked with List Boxes before so please be as thorough as you can be
Thank you everyone in advance