|
|
Query to conditionally handle duplicates
I'm creating a Bill of Materials using a one-to-many relationship table
between InternalPN and ExternalPN. So the query sometimes returns more than
one record when an InternalPN is specified, because there are multiple
External PN's. I would like to alert the user to this in my query by
substituting the word "Multiple" for the ExternalPN.
I can find multiples easily enough with the Query Wizard & so have created a
separate query called QryPNMultiple.
I'm trying to refer to that query in a dlookup statement in my BOM query.
I've tried this:
Expr1: DLookUp("NumberOfDups","QryPNMultiple","[PartNumID field] = LinkPN")
Everything works but the criteria. Keep getting errors about 'Access cannot
find field LinkPN' but I know it's there. Am I even going about this the best
way?
Thanks in advance.
|
|
0
|
|
|
|
Reply
|
Utf
|
4/21/2010 8:54:01 PM |
|
bicyclops wrote:
>I'm creating a Bill of Materials using a one-to-many relationship table
>between InternalPN and ExternalPN. So the query sometimes returns more than
>one record when an InternalPN is specified, because there are multiple
>External PN's. I would like to alert the user to this in my query by
>substituting the word "Multiple" for the ExternalPN.
>
>I can find multiples easily enough with the Query Wizard & so have created a
>separate query called QryPNMultiple.
>I'm trying to refer to that query in a dlookup statement in my BOM query.
>I've tried this:
>Expr1: DLookUp("NumberOfDups","QryPNMultiple","[PartNumID field] = LinkPN")
>
>Everything works but the criteria. Keep getting errors about 'Access cannot
>find field LinkPN' but I know it's there. Am I even going about this the best
>way?
>
>Thanks in advance.
We need to see the fields in the query. Do you really have a field called
[PartNumID field]?
--
Message posted via http://www.accessmonster.com
|
|
0
|
|
|
|
Reply
|
orange
|
4/22/2010 12:49:36 PM
|
|
Bicyclops -
The DLookup needs to evaluate the LinkPN outside of the double quotes, and
must reference a field from table in the query that is not the QryPNMultiple
query. It will look something like this if the LinkPN field is text:
DLookUp("NumberOfDups","QryPNMultiple","[PartNumID field] = '" &
[tablename].[LinkPN] & "'")
Or like this if the LinkPN is a number:
DLookUp("NumberOfDups","QryPNMultiple","[PartNumID field] = " &
[tablename].[LinkPN])
Is the [PartNumID field] supposed to be [PartNumID]?
--
Daryl S
"bicyclops" wrote:
> I'm creating a Bill of Materials using a one-to-many relationship table
> between InternalPN and ExternalPN. So the query sometimes returns more than
> one record when an InternalPN is specified, because there are multiple
> External PN's. I would like to alert the user to this in my query by
> substituting the word "Multiple" for the ExternalPN.
>
> I can find multiples easily enough with the Query Wizard & so have created a
> separate query called QryPNMultiple.
> I'm trying to refer to that query in a dlookup statement in my BOM query.
> I've tried this:
> Expr1: DLookUp("NumberOfDups","QryPNMultiple","[PartNumID field] = LinkPN")
>
> Everything works but the criteria. Keep getting errors about 'Access cannot
> find field LinkPN' but I know it's there. Am I even going about this the best
> way?
>
> Thanks in advance.
|
|
0
|
|
|
|
Reply
|
Utf
|
4/27/2010 4:45:01 PM
|
|
|
2 Replies
249 Views
(page loaded in 0.114 seconds)
Similiar Articles: Query help to remove duplicates - microsoft.public.access.queries ...Eliminate duplicate records with this built-in Access query ... The Find Duplicates Query wizard handles this chore quic ... database, it's a good idea to regularly remove ... Conditional formatting based on matching record in separate query ...I would like to conditionally format a patient's name (e.g., Bold) in a report ... Find Duplicate Records query that identifies all duplicate records based ... Finding duplicates accross two fields - microsoft.public.access ...Remove site location from the fields that are returned. ... site location. but some of the users are at multiple ... The Find Duplicates Query wizard handles this ... it ... Removing duplicate rows in a query - microsoft.public.access ...Eliminate duplicate records with this built-in Access query ... The Find Duplicates Query wizard handles this ... it's a good idea to regularly remove duplicate ... with 7 ... How to count duplicates... - microsoft.public.mac.office.excel ...... list i need to count the number of duplicates > > and while i have been able to conditionally ... have seen how we can delete all the duplicate records in one simple query. Access 2007 Allows Duplicate Primary Keys - microsoft.public ...Handle Duplicate Primary Key Field at Time of Entry Instead of at ... PPT 2007: Capture ... Access adds a Total row the the query design grid. ... How to tell nHibernate ... different color for duplicates!!! how? - microsoft.public.excel ...... table full of numbers, what i need is to find duplicates ... Connect to Store Ops DB #1 Open five different query ... Colors - Hello Im familiar with how to Conditionally Format... How to avoid duplicate entry in the subform - microsoft.public ...... duplicate" Me.Undo End If End Sub In the above, it checks in a query ... Handle Duplicate Primary Key Field at Time of Entry Instead of at ... Such as in a subform ... Conditionally Format A Line? - microsoft.public.access.reports ...It's currently just on my source query. I'll try it ... How to count duplicates... - microsoft.public.mac.office ... When I use the fill handle to propagate values, it ... remove duplicates from one cell at a time - microsoft.public ...In that case, you may be limited in how you can handle it in Access. Consider ... Delete duplicates QUERY - microsoft.public.access remove duplicates from one cell at a time ... Finding Duplicates with SQL - Pete FreitagHere's a handy query for finding duplicates in a table. Suppose you want to find all email ... i want to handle in queries like this col1 col2 col3 ali ... Excel - Append Query To Delete Duplicates - I have a series ...Append Query To Delete Duplicates - I have a series of quiers to ... lot of macros written about how to conditionally ... of data every month and my PC won't handle a ... Find, eliminate, or hide duplicate records in Access - Access ...This article also explains how to handle situations where some data may appear ... In the New Query dialog box, click Find Duplicates Query Wizard, and then click OK. Find Duplicates with Conditional Formatting in ExcelThis tutorial shows you how find duplicate data - formulas, numbers, dates, data records - in Excel using conditional formatting. The tutorial includes a step by step ... Eliminate duplicate records with this built-in Access query ...Effectively maintaining an Access database requires the regular removal of duplicate records. The Find Duplicates Query wizard handles this chore quic 7/14/2012 11:53:58 AM
|
|
|
|
|
|
|
|
|