Filtering Duplicate records on a main form

InQuery2004

Registered User.
Local time
Today, 14:46
Joined
Nov 12, 2004
Messages
24
I will try and be as concise as possible. I'm not sure how trivial a problem this is, but I haven't been able to find a solution on the internet regarding this issue.

The problem: I have a main form and sub form placed on two separate tabs. The form displays information about a particular employee in a company. Some of the records shown in the main form are duplicates based on a field named ProfileID. I would like to filter out these duplicate records based on this ProfileID field directly on the form. How can this be done and will it affect the records displayed in the subform?


Additional background:

Both the form and its subform are sourced to a paramaeter Query named ViewProfilesInfo. The query in turn has data from two source tables, one named Profiles and the other called ActionLog. Profiles represents the one side of a one-many relationship with ActionLog, with ProfileID being the joined field. A given profile record in the One table will habe many Procedure Numbers (A separate field) in the ActionLog table. My bug actually is caused by my Query, which will display a separate record for each unique result. So a given ProfileID will show many records in the Query because it has many ProcedureNo's related to it. When this Query is dipslayed on the form, it also shows each record in sub form (I want this) AND the main form (I don't want this)

Thanks for the help in advance.

Regards,

Mike J
 
A few questions, is the ProfileID the PKey in the main table, Profiles? I am a little confussed on why you are using a query for the main form, I usually use the table. Are the Master / Child links properly assigned. In the subform, I usually build a little query in the datasource. I have several forms with customer info on the main form and part info on the subform, which is usually several dozen part in length, some in continuous form and other in single form. hth.
 
Quest,

In response to your questions,

1. Yes Profile ID is the primary key in the main form/Table.

2. Why I used a query as the record source? That is a good question that I wanted to avoid. The only reason I can think of for using a query is that I need to utilize its parameter fields. You see this main form is linke to a another form that lists employee data such as bithdates, job tiltes, etc. When the user clicks a button, this Profiles form opens and a parameter query is used to determine the employee in question and their profile records. The parameter fields in the query of course, are linked to an Employee ID textbox in the Employees form.

Thus a user searches for John Smith and opens his general employment informantion. After clicking a "view profiles button" this opens the profiles form displaying all of John's Smith Profiles and their corresponding ActionLogs.


In sum, had it not been for this parameter query requirement, I would avoid the use of a query on the profiles form altogether.

I hope that helps.
 
Have you thoguht about making a copy of the dbase and striping the query? See if it works with out, it won't matter if it doesn't work, it is a copy. Just a thought. hth.
 
"Have you thoguht about making a copy of the dbase and striping the query?"

I am not quite sure what you mean by striping the query? Does that mean scrapping the query altogether? If that's the case, then how will I be able to
sort out the Profile records based on an EmployeeID field in the previous form?

Sorry to get into details, but I am pretty confused here.
 
Not really scraping, yet. Just use the method I previously mentioned to get the data into the form and just see if it works or maybe modify it a little bit and maybe then it will work for you. Sense it is a copy of the current dbase who cares what damage is done to it. If it works change it's name to the working one and off you go. I hiope I was clear enough for you. Well it is Miller time here, have a good one. hth.
 

Users who are viewing this thread

Back
Top Bottom