Hi Homer,
If you are willing to send me a compacted and zipped copy of your database,
I will take a look at it for you. My e-mail address is available on the
contributors page shown in my signature. Please do not post your e-mail
address (or mine) in a reply. This only invites the unwanted attention of
spammers.
I can't do too much with the SQL statements that you supplied, since I don't
know what the procedures SemiUnique and InvoiceTax are all about (referenced
in qry1), and qryCustInvoice looks like (referenced in qry2).
I see a field with a name that is considered a reserved word. While this may
not be the cause of any problems, my advice is to always avoid the use of
reserved words for anything that you assign a name to in Access:
DBA_rw_property.value
Reserved Words in Microsoft Access
http://support.microsoft.com/?id=286335
List of Microsoft Jet 4.0 reserved words
http://support.microsoft.com/?id=321266
I also see evidence of improper database design. For example, it appears as
if you are storing several totals in the table AR_POSTPRINTINVCDTL. If these
fields represent values that can be calculated from other fields in your
database, then the design is not correct. In general, you do not want to
store values that can be calculated. If AR_POSTPRINTINVCDTL is a query
instead of a table, then this does not apply.
In any case, I can provide more assistance if I actually have a copy of your
database to work with.
Tom
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
:
Here they are: the ---- line seperates qry1 to qry2
SELECT
IIf([AR_POSTPRINTINVCDTL].[BO_QTY]<=0.05*[AR_POSTPRINTINVCDTL].[SHIP_QTY],0,[AR_POSTPRINTINVCDTL].[BO_QTY])
AS BO_QTY, DBA_account.contact_acct_name, AR_POSTPRINTINVCDTL.SHIP_REF,
JobTracking.ProductFamily, AR_POSTPRINTINVCDTL.CO_NUMBER AS CONum,
AR_POSTPRINTINVCDTL.SHIP_STATE, AR_POSTPRINTINVCDTL.SHIP_CNTRY,
AR_POSTPRINTINVCDTL.SHIP_ZIP, AR_POSTPRINTINVCDTL.SHIP_CITY,
AR_POSTPRINTINVCDTL.CUST_PO_NO, AR_POSTPRINTINVCDTL.ITEM,
AR_POSTPRINTINVCDTL.ADD_DESC AS ITEM_DESC, AR_POSTPRINTINVCDTL.LN_NO,
AR_POSTPRINTINVCDTL.DUE_DATE AS NET_DATE, AR_POSTPRINTINVCDTL.ORDER_QTY,
AR_POSTPRINTINVCDTL.PAY_TERM, DBA_account.phone,
SemiUnique([AR_POSTPRINTINVCDTL].[AR_IVC_NO]) AS SEQN,
AR_POSTPRINTINVCDTL.SHIP_TO_NM, AR_POSTPRINTINVCDTL.SHIP_ADDR1,
AR_POSTPRINTINVCDTL.SHIP_ADDR2, AR_POSTPRINTINVCDTL.SHIP_VIA,
JobTracking.CreditCard, JobTracking.NumColors, JobTracking.ndim1,
JobTracking.ndim2, AR_POSTPRINTINVCDTL.UNIT_PRICE,
AR_POSTPRINTINVCDTL.CUST_ID, AR_POSTPRINTINVCDTL.SHIP_DATE,
AR_POSTPRINTINVCDTL.AR_IVC_NO AS INVOICE_NO, AR_POSTPRINTINVCDTL.SHPMNT_NO,
AR_POSTPRINTINVCDTL.TOTALLESS AS TOT_LESSX,
[AR_POSTPRINTINVCDTL].[TOT_PYMNTS]+[DISC_ALLWD] AS TOT_PYMNTS,
AR_POSTPRINTINVCDTL.TOTALSALES AS TOT_SALESX, InvoiceTax([AR_IVC_NO]) AS
TOT_TAXAMX, AR_POSTPRINTINVCDTL.TOTALOTHER AS TOT_OTHERX,
[TOTALSALES]+[TOTALFRGHT]+[TOTALLESS]+[TOTALOTHER]+InvoiceTax([AR_IVC_NO]) AS
TOT_IVCX, AR_POSTPRINTINVCDTL.TOTALFRGHT AS TOT_FRGHTX, JobTracking.Copy,
DBA_account.fax, [SHIP_QTY]*[UNIT_PRICE] AS EXTD_PRICE,
JobTracking.ReturnDisk, JobTracking.ReturnArt, JobTracking.SendSamples,
AR_POSTPRINTINVCDTL.IVC_DATE, AR_POSTPRINTINVCDTL.SHIP_QTY AS SHIPD_QTY
FROM DBA_account RIGHT JOIN (AR_POSTPRINTINVCDTL INNER JOIN JobTracking ON
AR_POSTPRINTINVCDTL.CO_NUMBER = JobTracking.CO_Number) ON
DBA_account.ext_acctid2 = AR_POSTPRINTINVCDTL.CUST_ID
WHERE (((AR_POSTPRINTINVCDTL.IVC_TYPE)="I"));
-------------------------------------------
SELECT DISTINCT DBA_part.user_code_2, DBA_part.user_code_1,
DBA_line_dtl.line_status, DBA_order_header.head_lead_time, qryCustInvoice.*,
DBA_rw_property.value, ShipMast.COD_Amount, MaterialCodes.MatlDesc,
DBA_rw_property.item_id
FROM ((ShipMast RIGHT JOIN (((qryCustInvoice INNER JOIN DBA_order_header ON
qryCustInvoice.CONum = DBA_order_header.head_order_nbr) INNER JOIN DBA_part
ON qryCustInvoice.ITEM = DBA_part.item) INNER JOIN DBA_rw_property ON
DBA_order_header.head_order_nbr = DBA_rw_property.head_order_nbr) ON
ShipMast.CO_Number = DBA_order_header.head_order_nbr) LEFT JOIN MaterialCodes
ON DBA_rw_property.value = MaterialCodes.MatlRef) INNER JOIN DBA_line_dtl ON
(DBA_line_dtl.line_number = qryCustInvoice.LN_NO) AND
(DBA_order_header.head_order_nbr = DBA_line_dtl.head_order_nbr)
WHERE (((DBA_part.user_code_1)<>"I" And (DBA_part.user_code_1)<>"T" And
(DBA_part.user_code_1)<>"O") AND ((DBA_rw_property.item_id)="Cut_Type") AND
((qryCustInvoice.UNIT_PRICE)=0)) OR (((DBA_part.user_code_1)<>"I" And
(DBA_part.user_code_1)<>"O") AND ((DBA_rw_property.item_id)="Cut_Type") AND
((qryCustInvoice.UNIT_PRICE)>0)) OR (((DBA_part.user_code_2)="N") AND
((DBA_part.user_code_1)="O") AND ((DBA_rw_property.item_id)="Cut_Type") AND
((qryCustInvoice.UNIT_PRICE)>0)) OR (((DBA_part.user_code_2) Is Null) AND
((DBA_part.user_code_1)="O") AND ((DBA_rw_property.item_id)="Cut_Type"));