E
Ed from AZ
We have vehicles of different types which run various routes during
the day. We have about 15 different routes, but that number can be
added to at any time. We want to track which vehicles have run which
routes and how many circuits they did on each route, with data being
input on a daily basis.
I have a table of vehicle types and table of vehicle IDs by type, with
cascading ListBoxes so I choose the vehicle type and then choose an ID
from the available choices. I also have a TextBox to input the date.
The question now is about handling the inputting of routes and number
of circuits. Currently I have one data table with fields for:
Autonumber, veh type, veh ID, date, and one field for each route. I'm
wondering if this is best, or if I should have a separate table for
each route.
Rather than have one blank for each route, I'd like to have the data
input form contain maybe seven pairs of one ListBox drop-down with a
list of routes and a TextBox for number of circuits.
A couple of thoughts/questions:
-- Having one data table vice separate tables for each route seems to
me easier to add a route. I just need to add a new field to the data
table, rather than create a new table. Is this correct thinking?
-- I'd like to have some kind of error checking to allow a route to be
chosen only once on the Input form. Elegant, I think, would be to
somehow remove any previously selected routed from the choices
available in the remaining ListBoxes. Adequate, though, would be to
capture each selection into a string, and then check the new selection
against the string (If InStr > 0 Then "You already picked this
one!"). What would be best for a newbie to attempt?
-- Can someone point me to a sample for creating the statements
necessary to gather the data from the form and write it into the data
table? In my mind, I need to iterate through the pairs of route/
circuit data, pick up the chosen route as the field name, and grab the
number as the data to write in that field. Is that the hard way or
the easy way?
Ed
the day. We have about 15 different routes, but that number can be
added to at any time. We want to track which vehicles have run which
routes and how many circuits they did on each route, with data being
input on a daily basis.
I have a table of vehicle types and table of vehicle IDs by type, with
cascading ListBoxes so I choose the vehicle type and then choose an ID
from the available choices. I also have a TextBox to input the date.
The question now is about handling the inputting of routes and number
of circuits. Currently I have one data table with fields for:
Autonumber, veh type, veh ID, date, and one field for each route. I'm
wondering if this is best, or if I should have a separate table for
each route.
Rather than have one blank for each route, I'd like to have the data
input form contain maybe seven pairs of one ListBox drop-down with a
list of routes and a TextBox for number of circuits.
A couple of thoughts/questions:
-- Having one data table vice separate tables for each route seems to
me easier to add a route. I just need to add a new field to the data
table, rather than create a new table. Is this correct thinking?
-- I'd like to have some kind of error checking to allow a route to be
chosen only once on the Input form. Elegant, I think, would be to
somehow remove any previously selected routed from the choices
available in the remaining ListBoxes. Adequate, though, would be to
capture each selection into a string, and then check the new selection
against the string (If InStr > 0 Then "You already picked this
one!"). What would be best for a newbie to attempt?
-- Can someone point me to a sample for creating the statements
necessary to gather the data from the form and write it into the data
table? In my mind, I need to iterate through the pairs of route/
circuit data, pick up the chosen route as the field name, and grab the
number as the data to write in that field. Is that the hard way or
the easy way?
Ed