Solved

Application/DoCmd Echo and Painting Not Working

Posted on 2008-10-30
5
410 Views
Last Modified: 2011-10-19
    I have reviewed many posts regarding this problem but none of the information has solved my problem.  I have a form with combo boxes used to create a filter for the underlying recordset of the form.  The filtering works but I would like to eliminate the extra "interim" records that are displayed prior to getting to the desired record.  By extra "interim" records I mean that when the user makes a selection in the combo of a CustomerID, the CustomerID displayed at the time the combo selection is made, may be contained within the newly filtered group of records.  If it is, I want it to remain the currently displayed record when then filter is set.  What happens is that the first record of the filtered recordset displays first then the previously current record is displayed.  I do not want to see the "interim" first record of the filtered recordset.  The relevant code looks like this:

Me.FilterOn = False
Me.Filter = ""
Dim strFormFilterSQL as string
strFormFilterSQL = "Some Criteria"
Me.Filter = strFormFilterSQL
Me.FilterOn = True
If cboCustIDFilter = CustID_Displayed_B4_Filter_Was_ Set Then
     'Get the record for CustID_Displayed_B4_Filter_Was_ Set
End if

     This seems like it should be very simple but I have tried placing DoCmd.Echo, Application.Echo and Me.Painting at various locations in the code and cannot get the "Interim" record to stop displaying.
     Can any of the experts out there tell me if this can be done and, if so, how?



0
Comment
Question by:donthee
  • 2
5 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 22843135
perhaps a picture or image of your form would help to understand what you want to happen. (plus the explanation)
0
 

Author Comment

by:donthee
ID: 22843251
Perhaps all the words of explanation have obscured the simplicity of this problem.  The user is sitting there with an invoice form whose underlying recordset is all invoices for all customers. The user selects a customer from a combo box which filters the invoices to that customer.  If the invoice currently displayed on the screen is for a customer that falls within the filtered customer group, I want the user to see that one, not the first one of the newly filtered group of records.  This works but in doing so the first record of the newly filtered recordset is displayed followed by  the desired one.  I don't like the way this looks (too much movement on the form).  So, how can I keep the first record of the newly filtered recordset from displaying?
0
 

Author Comment

by:donthee
ID: 22843356
Here's a picture of the form in question.
Echo-Not-Working.jpg
0
 
LVL 2

Accepted Solution

by:
zoom2000 earned 500 total points
ID: 23001993
Why dont you use the bookmark Property of the form


dim rs as recordset
set rs = me.recordsetclone

' Save the Bookmark  first
set rs.bookmark = me.bookmark

If cboCustIDFilter = CustID_Displayed_B4_Filter_Was_ Set Then
 me.bookmark = rs.bookmark
End if


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now