Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 18th, 2005, 08:31 AM
Registered User
 
Join Date: Apr 2005
Location: Boston, MA, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Basing one combo on another - filter problem

I have created a form with two combo fields.

When you make a selection from the first field, the drop down list in the second field is limited by a query based on the first combo selection. The second combo queries like:

SELECT TblGrant.GrantID, TblGrant.GrantTypeID, TblGrant.GrantSubType FROM TblGrant WHERE (((TblGrant.GrantTypeID)=Forms!FrmWorkPlan!GrantTy pe));

and GrantType is the pick in the first combo.

I have also coded:

Private Sub GrantType_AfterUpdate()
    Me.GrantSubType = Null
    Me.GrantSubType.Requery
    Me.GrantSubType = Me.GrantSubType.ItemData(0)
End Sub

Private Sub Form_Current()
    Me.GrantSubType.Requery
    Me.ProjectName.Requery

End Sub

All works well except when I try to filter by form. The first combo works as expected but the second combo does not requery.

I have looked at several examples in the MicroSoft library - none of them will update the second combobox in filter by form either. I do not know how to force the second combo to requery in the filter by form situation.

Perhaps one of you has some thoughts on this topic??



Reply With Quote
  #2 (permalink)  
Old May 21st, 2005, 10:47 AM
Friend of Wrox
 
Join Date: Nov 2004
Location: Seattle, WA, .
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

I wonder if it does not requery only for specific records. I.e. Perhaps the record you have filtered to has a value for GrantSubType that isn't valid based on the GrantType and therefore the Select for the second combo doesn't allow a value to display for GrantSubType. Make sure that the code doesn't work at all when you're filtering. Make sure that the GrantSubType is valid in combination with the GrantType. Also make sure that your filter by form doesn't specify a filter with an invalid GrantType/GrantSubType combination. That could be restricting the display.

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to apply filter to shrink combo box records beetle_jaipur Access 3 July 28th, 2007 01:58 AM
Subform Filter based on Multiselect Combo boxes natwong Access 2 November 16th, 2006 10:05 AM
Subform Filter using Multiple Combo boxes natwong BOOK: Expert One-on-One Access Application Development 0 November 13th, 2006 03:07 PM
Filter records using a combo box tixe83 Access 2 August 3rd, 2006 12:43 PM
Filter by Combo Boxes Corey Access VBA 5 June 1st, 2006 07:33 PM



All times are GMT -4. The time now is 04:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.