View Full Version : Dynamic combo?


robywan
02-22-2002, 05:19 AM
I have a big problem (for me).
I created an Access Database consisting of 4 tables:
- employees (fields: ID_employee, Name, Surname)
- activities (fields: ID_activity, Descr_activity)
- subactivities (fields: ID_activity, ID_subactivity, Descr_subactivity)
- works (fields: ID_work, ID_employee, ID_activity, ID_subactivity)

I also created a form to input works, with combo boxes that catch data from the first three tables.
After chosing an activity, I'd like in the second combo to read only the subactivities related to the activity chosen, or nothing if it has none.

I created a query as the origin of the data of subactivity box,
setting the value of [subactivities.ID_activity] like the content of the upper box (activities), but it runs only the first time (i.e. when I open the form). If I modify activity, subactivities don't update.

I also tried to put a macro on the activities box: when the content changes, it updates all the form, but I had no results.
My attempts:
- "Update query" -> error: the query is not open.
- "Open query", "Update query", "Close query" -> nothing
- "Update form" -> nothing

I also tried to put the subactivity box into a submask and I set the command "update form" (i.e. the submask) -> no results.

What can I do?
Thanks,
robywan

Rich
02-22-2002, 05:44 AM
In the after update or change event module of your combo put Me.Requery