Combobox

Caddie

Registered User.
Local time
Yesterday, 16:30
Joined
Feb 16, 2010
Messages
75
Hi -

I've created a form to manage the passing of paramaters onto a report. I've got three comboboxes on the form:

Customer #
Sector (Enterprise, Public or Carrier)
Region (Cities)

These comboboxes are tied to tables and then selections are then passed into the query as paramaters. Also, I've set it up so if the user chooses a customer and they only have service in City A, then only City A appears in the Region combobox; however, if a user changes their mind and selects another Customer, the old region is still listed (even though they don't have service in that city, therefore when you run the report it is blank). I'd like it so if after you make any changes (select a customer, then go back and change it) that the other two comboboxes are reset back to being blank. Forcing the user to make their choice again.

How would I go about doing this?

Thanks.
 
It sounds like you need to requery the second combo from the after update of the first. You may also want to clear any selection in the second. I have a little demo here:

http://www.baldyweb.com/CascadingCombo.htm

Now let me have my 9 iron. :D
 
Requery those combo boxes in the change event of the customer combo.

Brian
Dman Paul beat me again.

Actually that was supposed to say Damn, but I think the original is better.
 
It's that cold, rainy air over there; it slows down your fingers! :p
 
Yeah , that and old age, they both fog up the grey matter. :(

In the new post list we briefly had caddie and Driver next to each other !!

Brian
 
Your example works well, assuming the user has to chose a state first. However, in my situation I the user can run the report only by 1 sector, or 1 city or 1 customer. Or they can chose 1 customer then chose a city that the customer has service in. The only way I can see this happening would be if the whole form is cleared if they update an already inputed selection. The problem with using the 'after update' event is that would trigger even if the user was making their initial selection, wouldn't it?
 
Yes, the after update event will trigger whenever they change the value. You could add code to only affect other combos if no selection has been made in them yet. I guess I'm not totally sure what the issue is; maybe Brian sees it better.
 
No Paul I don't understand why he is saying that your proposal wont work.

I'm about to leave but maybe he needs to attach his db.

One point he says that his combos are tied to tables, but I presume that they are populated by queries.

Brian

BTW I notice that you use the afterupdate event, is that preferable to the change event?
 
I think the update event is better. If the user types in an entry, the change event fires with every keystroke. If they select using the drop down, then it really wouldn't matter, but I like to allow for either. I only use the change event when I need to check what the user is typing, keystroke by keystroke, which for me is not that often. In the case of cascading combos, you really only care about the final selection.
 
I think the update event is better. If the user types in an entry, the change event fires with every keystroke. .

Thanks Paul, I shall remember that, fortunately I've only used it for combo or list box selections so no harm done, but the principle is the thing, mind you I only use ACCESS on here since I retired 4 years ago. :D

Brian
 
Users can still type into a combo box; mine do it all the time (I have a lot of "head down" data entry people).

And stop rubbing our faces in the fact that we're still slaving away at work while you work on your tan! :p :D
 
Thanks a lot; that literally made me laugh out loud. Now my coworkers think I'm crazy (okay, crazier). :D
 

Users who are viewing this thread

Back
Top Bottom