Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Combo Box Field

Status
Not open for further replies.

RacerGirl117

Technical User
Sep 25, 2002
234
US
I commonly use a filter field on a lot of my forms. They're pretty much all the same because a lot of what we do here is based on jobs/projects. Anyway, now I am attempting to do something based on the customer number, not the job number. I want to create a filter/combo box that a user can enter the customer number in to narrow the record to the customer they want to see.

The form I am working on will at some point have a total of 3 subforms (via a tab control form). I have the first subform in already and have the master/child link set up between the main form (where the "master" customer number resides). Both the main form and the subform have a customer number field.

One of the problems (I mean "challenges" :) ) with this so far is that when you open the form, Service/Warranty Info, prior to linking the master/child fields the main form displays it's 11693 records and the subform displays it's 16071 records. But as soon as you apply the Cust No links and open the form again, all you get is the data in the main form.

A form I already have in existence is the Jobs form. This consists of the main form and 4 subforms. When a user opens this form, they can go to the Job No. Filter field, enter a Job No. and the associated record(s) in the main form and each of the subsequent subforms is pulled up and all the user sees is data associated with, say, Job No. 20G111A.

I'd like to do the same thing, in principal, with this Service/Warranty Info. form but with the user filtering by the Customer No. I have a combo box based on a query and in the AfterUpdate property of the combo box I have the following code:
Private Sub CustNoFilter_AfterUpdate()

If Me![CustNoFilter] = &quot;<All>&quot; Then
DoCmd.ShowAllRecords
Else
DoCmd.ApplyFilter , &quot;[Cust No] = [Forms]![frmSvcWarrInfoMainForm]![CustNoFilter]&quot;
End If

End Sub

I have the same exact code in the aforementioned Jobs form and it works just fine. I use this code in most of the filter fields I've created and have not had any problems so I thought this would be as simple as copying the code and replacing the field and form names. But this is not working. I just checked the relationships and there are relationships of one-to-many between the &quot;main&quot; table (tblCustomers) and each of the other &quot;sub&quot; tables so I don't think that is where the problem is.

One thing I should mention is that each of the tables are linked tables to external data sources. Meaning that the information is being extracted from our accounting system and is pulled into Access using Pervasive. Don't know if that has anything to do with it.

Any ideas or suggestions would be greatly appreciated. Jessica Morgan
Fire Fighter Sales & Service Co.
Pittsburgh, PA
 
I just had an additional thought...

Since the record sources are external and the recordsets are not updatable, could this be the cause of the filter field not working? Jessica Morgan
Fire Fighter Sales & Service Co.
Pittsburgh, PA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top