trouble selecting items in combo box, subforms won't refresh

T

terribly confused

ok i'm totally stumped. i've been through all of the forums with no luck with
this specific problem.

i am creating a form in access 2003 that will have a combo box which the
user chooses a city/location from (i.e. denver, paris, etc.). when they
select the city, the subform displays that city's associated task ID numbers
(with accompanying descriptions). i also want the user to be able to
"scroll" through the city's records (using the little "Fast forward" arrow
buttons at the bottom of the form) while updating the city's information in
both the subform and the combo box (which is usually does automatically).

the location and it's "city ID" are in one table (and make up the info for
the combo box), where the city ID is an auto number that is assigned in order
to new cities entered into teh table.
the task id's and their descriptions are in another table, and that table
makes up the subform data.

there are 3 different situations i have tried depending on the control
source of the combo box, listed below:

1) control source is set to "location ID" (record source is the city, i.e.
denver, and the location id is the city's associated assigned ID#, i.e. 4).
this is near perfect to what i want to be able to do with this form, in that
i can scroll (using the record arrow buttons at the bottom of the form)
through all of the cities and their respective task ID's show up in teh
subform appropriately, and the combo box city is also updated to show the
city for the task ID's. the only problem is that i can not actually select
anything in teh combo box, everytime i try i get a "sound error" (a little
"DING!"), but no actual error pops up. at the bottom of access in teh status
bar, it says that the control cannot be changed, due to it being "bound" by
autonumber of the location ID. i am not really sure what i am supposed to do
to change this, as the cities are entered using a different form that
automatically assigns the city to a id number.

2) the control source is set to the actual city name (i.e. denver) instead
of the id of that city. this allows me to select items from teh combo box
and have their appropriate task ID's show up in the subform, but it rewrites
the entries in teh table and changes city names to random numbers (i.e.
denver becomes "4"). i also am not able to scroll through the city records
using the record buttons at the bottom of the form, it simply updates the
subform information but not the city information (and therefore, new task
ID's and their descriptions get assigned to the wrong city).

3) the control source is left empty (unbounded). this has similar results
as the second problem, however it comes up with many compile/syntax errors
that don't really make sense.

i have tried using code in VB:

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

but it hasn't helped as i can't even select a city from teh combo box.

in a nutshell, i want the results i get from situation (1) listed above,
except i want to be able to choose the city from the combo box as well
(hopefully without the annoying "ding!" error sound!!)

any help would be greatly appreciated, as i've worked hours and hours on
this problem =\

Thanks^^
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top