L
lindsay
ok. i'm completly stumped. in my access form(design view), i used the wizard
to create a combo box that would list various cities that one can choose from
(location table). i selected the third option for the combo box, so that the
combo box selection will "find a record on the form based on teh value i
selected in my combo box".
depending on the selection i make, i want my subform (which is based on a
different table, task ID table) to show the various task ID's for that
specific location.
so i have three different situations that occur depending on the control
source of the combo box.
1) the control source is the location's ID number (which is an auto number
assigned to locations when they are entered into the data). this results in
the form being as close to what i want as possible. when i click the right
arrow button of the city records (in order to view other city's task ID's),
the city in teh combo box changes accordingly, as do the task ID's for that
city. HOWEVER, i cannot select anything in the actual combo box (i get that
quirky "error" sound, but no actual error pop-up box. in the status bar at
the bottom of Access, it says "control can't be edited, it's bound to
autonumber by 'location ID'". but other than that, everything works fine.
2) control source is set to the location's actual name (i.e. denver, paris,
etc.). i now can select the city from the combo box and it's appropriate
id's for that city show up, but i get numerous errors in trying to do so
(random errors such as compile errors). however, it changes the name of the
city in both the combo box AND the original location table to a randomly
generated number.
3) the control source is unbounded (i.e. there is nothing in the control
source text box). i can select the city and the appropriate task ID's come up
for that city, however if i use the bottom right arrow buttons to "scroll"
through the city records, it changes the ID's, not the city. therefore, when
i enter in a new id for a city, it doesn't always get associated with the
right city (or in most cases, it's assigned to a "0" city, which doesn't
actually exist).
overall, option 1 brings me closest to what i want, to be able to select a
city from a dropdown menu (combo box) and have the subform reflect the
accurate task id's for that city, as well as being able to scroll through the
cities (the records) via the little arrow buttons at the bottom of the form.
i'm tried using VB code and such, but i keep getting runtime errors for the
following code: (combo box name is "please select a city")
Private Sub Please_Select_a_City_AfterUpdate()
temp = "SELECT [Local TKST ID's and Descriptions].[Local TKST IDs],
[Local TKST ID's and Descriptions].Description, [Local TKST ID's and
Descriptions].[Location ID] FROM [Local TKST ID's and Descriptions]" + "WHERE
[Local TKST ID's and Descriptions].[Location ID] =" +
Please_Select_a_City.Location_ID
Form.limited_Local_TKST.RecordSource = temp
Form.limited_Local_TKST.Refresh
End Sub
i wanted to try to create a query that would match the task id's of the city
with the city that i select from the combo box. it hasn't worked, primarily
because i simply can't actually select anything from teh menu.
i'm terribly sorry this is such a long question, i've gone through all of
the forums looking for an answer and haven't been able to find one =\
please help!!
to create a combo box that would list various cities that one can choose from
(location table). i selected the third option for the combo box, so that the
combo box selection will "find a record on the form based on teh value i
selected in my combo box".
depending on the selection i make, i want my subform (which is based on a
different table, task ID table) to show the various task ID's for that
specific location.
so i have three different situations that occur depending on the control
source of the combo box.
1) the control source is the location's ID number (which is an auto number
assigned to locations when they are entered into the data). this results in
the form being as close to what i want as possible. when i click the right
arrow button of the city records (in order to view other city's task ID's),
the city in teh combo box changes accordingly, as do the task ID's for that
city. HOWEVER, i cannot select anything in the actual combo box (i get that
quirky "error" sound, but no actual error pop-up box. in the status bar at
the bottom of Access, it says "control can't be edited, it's bound to
autonumber by 'location ID'". but other than that, everything works fine.
2) control source is set to the location's actual name (i.e. denver, paris,
etc.). i now can select the city from the combo box and it's appropriate
id's for that city show up, but i get numerous errors in trying to do so
(random errors such as compile errors). however, it changes the name of the
city in both the combo box AND the original location table to a randomly
generated number.
3) the control source is unbounded (i.e. there is nothing in the control
source text box). i can select the city and the appropriate task ID's come up
for that city, however if i use the bottom right arrow buttons to "scroll"
through the city records, it changes the ID's, not the city. therefore, when
i enter in a new id for a city, it doesn't always get associated with the
right city (or in most cases, it's assigned to a "0" city, which doesn't
actually exist).
overall, option 1 brings me closest to what i want, to be able to select a
city from a dropdown menu (combo box) and have the subform reflect the
accurate task id's for that city, as well as being able to scroll through the
cities (the records) via the little arrow buttons at the bottom of the form.
i'm tried using VB code and such, but i keep getting runtime errors for the
following code: (combo box name is "please select a city")
Private Sub Please_Select_a_City_AfterUpdate()
temp = "SELECT [Local TKST ID's and Descriptions].[Local TKST IDs],
[Local TKST ID's and Descriptions].Description, [Local TKST ID's and
Descriptions].[Location ID] FROM [Local TKST ID's and Descriptions]" + "WHERE
[Local TKST ID's and Descriptions].[Location ID] =" +
Please_Select_a_City.Location_ID
Form.limited_Local_TKST.RecordSource = temp
Form.limited_Local_TKST.Refresh
End Sub
i wanted to try to create a query that would match the task id's of the city
with the city that i select from the combo box. it hasn't worked, primarily
because i simply can't actually select anything from teh menu.
i'm terribly sorry this is such a long question, i've gone through all of
the forums looking for an answer and haven't been able to find one =\
please help!!