Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 11th, 2005, 07:37 PM
Registered User
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Recalc the CurrentRecord

Hi All,
I have an Order form with an Order Details sub form.
The sub form has 3 fields (cboCategoryID; cboPublicationID & Quantity)
I use the cboCategory drop down field to filter the cboPublication field (so I don't have to see 100 pub's each time). I finally got the filtering to work correctly by adding "[Forms]![frmOrders]![SubForm].[Form]![ cboCategoryID]" to [tblPublications]![CategoryID] criteria.
When I enter my first record (publication) in my subform the cboPublicationID field filters correctly from the cboCategoryID field option I selected. Problem comes when I move down to the next record and pick a new cboCategoryID option, as the cboPublicationID field filter still uses the first filter option. So if I filter for books only on the first record and I filter for videos on the next record, the cboPublicationID field is still filtering on books. If I close and reopen the orders form a few times I can get the new record to filter correctly. Tried using the Me.Recalc option in the cboCategoryID AfterUpdate event but it clears all the cboPublicationID field records, I just need the current record to recalc.
Is there a way to Recalc the CurrentRecord only in my sub form or some other way I can get the cboPublicationID field to pick up the new cboCategoryID filter option?
Thanks big in advance!!!!

Old February 12th, 2005, 08:23 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts

Have you tried refreshing or requerying the combo box underlying query?

Clive Astley
Old February 12th, 2005, 10:16 PM
Registered User
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Yes. Requerying blanked out all the records on the current form.
Refresh didnt updated the sort data. I’ve tried many; many different scenarios. Thanks for asking. I plan on trying the following SQL next:

    Dim strSQL As String

    strSQL = " SELECT tblPublications.PublicationID,tblPublications.Publ icationName, tblPublications.PubCode, tblPublications.CategoryID FROM tblPublications Where tblPublications.CategoryID = Combo1 AND tblPublications.LanguageID = Combo2 ORDER BY tblPublications.PublicationName;"
    PublicationID.RowSource = strSQL
    'DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.