Re: Cascading Combo help

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Tara" <Tara@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:4291722F-4481-410F-AF86-C71A1AC1DAEF@xxxxxxxxxxxxxxxx
I have two combos on a frmEmployees. 1st combo is cboCity, 2nd is cboZip.
Both are based on the same table. I'm trying to get the second combo to be
limited based on what is chosen in the first combo, but it doesn't appear
that the After Update Event is firing at all. That or I'm missing something
obvious.

The 1st combo's RowSource is as follows:

SELECT DISTINCT [tblZip].[strCity] FROM tblZip ORDER BY [tblZip].[strCity];

The 2nd Combo's RowSource is:

SELECT [tblZip].[numZip], [tblZip].[strCity] FROM tblZip WHERE
((([tblZip].[strCity])=[forms]![frmEmployee]![City]));

In the After Update event of the 1st combo I have:

Me.cboZip.Requery

I've also tried using DoCmd.Requery "cboZip"

Interestingly, if I run the query behind cboZip independently of the After
Update Event, it works fine!

What am I missing here???


I trust that the first combo box is either named "City" or is bound to the [City] field.

Maybe the AfterUpdate event is not firing. Is the AfterUpdate event property of the combo box set to "[Event Procedure]"? If you put a breakpoint in the event procedure, does execution hit that breakpoint when you choose a value in the combo box?

Does other VBA code in the database execute? This isn't Access 2007 with VBA code disabled, is it?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

.



Relevant Pages

  • Re: Null needs to be shown as 0 regardless
    ... If you are entering data through a form, you can use VBA code in the BEFORE UPDATE event of the form ... Query the Status field to report on total closed work orders minus ...
    (microsoft.public.access.queries)
  • Re: Two date fields - auto fill tick box if 6 weeks or more apart
    ... Use VBA code in the form in the after update event of the ... small sub in the form's module and then call that sub from the afterupate ... event of the two controls. ...
    (microsoft.public.access.queries)
  • Re: Default value of one field in access to contents of another fi
    ... I don't think you can accomplish this in a table. ... update event of a text box on a form to set the value of another text box: ... MS Access MVP ... > the first time I have used this service. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: combo box programming
    ... "Ken Snell " wrote: ... <MS ACCESS MVP> ... However, after updating the ... combo box update event to make it go away. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Making test box visible
    ... "John W. Vinson" wrote: ... The above code goes in the After update event for the combo ... Replace NameOfCombo and NameOfTextbox with the real names. ... Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia ...
    (microsoft.public.access.forms)