I am already able to jump to records using the Go To CBO on the screen (its hidden so all that you see is the controls dropdown arrow). The problem is that I need a query that populates the dropdown records listing to be filtered based on the forms filter clause and filterOn property.
Currently, the Go to CBO is using an embedded query statement for the record source. I can duplicate the SQL statement in VBA but do know how to apply the filter criteria to the SQL where clause and then push it back into the CBO.RecoordSource property.
The code I included shows the code I am using to build the form.filter clause can the property value be used for a where clause?
Main Topics
Browse All Topics





by: thenelsonPosted on 2009-09-17 at 15:44:14ID: 25361795
Any of the following three methods will search within a filtered report:
ate() 'Use the name of your list/combo box
ate() 'Use the name of your list/combo box
Three easy ways to jump to a record in a combobox but still be able to scroll through all the other records:
1) The combo box and list box wizard will do this for you automatically. In the first or second step (depending on you version of Access), choose the third option: "Find a record on my form based on the value selected in my combo box" This must be done on a BOUND form.
2) Have the record ID number as one of the fields in the list/combo box and in the form (they can both be hidden). The bound column of the list/combo box is the record ID field. Then the On After Update Event of the list/combo box would look like:
Private Sub List/ComboBoxName_AfterUpd
txtRecordID.SetFocus 'Use the name of your text box
DoCmd.FindRecord List/ComboBoxName 'Use the name of your list/combo box
End Sub
3) Again, the bound column of the list/combo box is the record ID field.
Private Sub List/ComboBoxName_AfterUpd
Me.RecordSet.FindFirst "txtRecordID = " & List/ComboBoxName 'Use the name of your list/combo box and text box
End Sub