Application/DoCmd Echo and Painting Not Working
Posted on 2008-10-30
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
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?