Bill,
You should requery the combo box in the On Current event of the form as well as the after update event of the [Forms]![frmCascading]![CategoryID].
Duane Hookom MVP
MS Access
----------------------------------------
> To: MS_Access_Professionals@yahoogroups.com
> From: Bill.Singer@at-group.net
> Date: Wed, 7 Aug 2013 09:09:05 -0500
> Subject: RE: [MS_AccessPros] Cascading combo box problem
>
> Duane,
>
> Interesting concept. Does this code automatically update each time you move
> from one record to another? If it does I am wondering why. Currently my
> 2nd combo has a refresh macro on the got focus property but that does not
> fire when I move from one record to another.
>
>
>
> Bill Singer
>
> MN
>
>
>
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Duane Hookom
> Sent: Tuesday, August 06, 2013 10:03 AM
> To: Access Professionals Yahoo Group
> Subject: RE: [MS_AccessPros] Cascading combo box problem
>
>
>
>
>
> Bill,
>
> There are a couple solutions. I typically don't limit the Row Source of the
> second combo box but sort the returned records with the acceptable values at
> the top and the remainder at the bottom. I will also add a column that
> displays a visual indicator of the not acceptable values.
>
> For instance a continuous form for selecting a category and then product
> might have a productID row source like:
>
> SELECT Products.ProductID, Products.ProductName,
> IIf([CategoryID]=[Forms]![frmCascading]![CategoryID]," (OK)"," (NOT)") AS
> Expr1
> FROM Products
> ORDER BY IIf([CategoryID]=[Forms]![frmCascading]![CategoryID]," (OK)","
> (NOT)"), Products.ProductName;
>
> You can add code to check the third column cboProductID.COlumn(2) to make
> sure it is (OK) after updating.
>
> Duane Hookom MVP
> MS Access
>
> ----------------------------------------
>> From: Bill.Singer@at-group.net <mailto:Bill.Singer%40at-group.net>
>>
>> I have a form that has a two combo boxes. They are cascading, the second
>> combo box runs off of a query. The query changes the election options in
>> the second combo box based on the selection in the first combo box. During
>> the initial record input the combo boxes work perfect. However, recently
> as
>> we have to go back and view some of the records, the second combo box is
> not
>> updating. As I scroll through the records the first combo box will update
>> but the second combo box typically just goes blank. It will not update
>> unless I click on it or use the refresh button in the menu.
>>
>>
>>
>> Is there a way to get the second combo box to update/refresh each time a
>> record is changed. I would have typically tried to go to the form
>> property "on Current" and tried to put a refresh in there but I already
> have
>> an event in there.
>>
>>
>>
>> What is the best way to accomplish this.
>>
>>
>>
>> .as always, thanks for your wisdom.
>>
>>
>>
>> Bill Singer
>>
>> MN
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (8) |
Tidak ada komentar:
Posting Komentar