Need help with append query, please

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Using A2K. I've got a subform that displays a list of agencies by date for
each client. For example, currently there are 10 agencies. Client #59 has
30 agency records: one set for 6/22/2005, one set for 7/1/2005, and one set
for 7/15/2005. If the user adds an agency for #59 on the 6/22/2005 set, an
append query is created in the AfterUpdate of the agency name to append this
new agency to all other clients. Here's the query:

INSERT INTO tblAgencyAssistance ( ID, AgencyAssistance, AssistanceDate,
AssistanceAmount )
SELECT DISTINCT tblAgencyAssistance.ID, "AAA" AS Expr1,
tblAgencyAssistance.AssistanceDate, 0 AS Expr2
FROM tblAgencyAssistance
WHERE (((tblAgencyAssistance.ID)<>59) AND
((tblAgencyAssistance.AssistanceDate)<>#6/22/2005#));

This WHERE clause ignores all records for #59. However, there should be a
new record appended for 7/1/2005 and a new record for 7/15/2005. If I don't
use the clause I get duplicate 6/22/2005 records for #59.

Can anyone tell me what I'm doing wrong? Below is a sample of
tblAgencyAssistance if that helps:

ID AgencyAssistance AssistanceDate AssistanceAmount
59 Dental Assistance 6/22/2005 $6.00
59 Dental Assistance 7/1/2005 $10.00
59 Dental Assistance 7/15/2005 $0.00
60 Dental Assistance 6/1/2005 $14.00
60 Dental Assistance 7/1/2005 $15.00
61 Dental Assistance 7/1/2005 $0.00


Thanks for any help or advice.


.



Relevant Pages

  • Re: CoBOL and Contracting (Was: All X0D lost during...)
    ... multiple agencies for the same client slots. ... Apply to ALL the agencies. ... but to a different agency. ... Some advise calling every other day for a progress report. ...
    (comp.lang.cobol)
  • Re: CoBOL and Contracting (Was: All X0D lost during...)
    ... multiple agencies for the same client slots. ... Apply to ALL the agencies. ... but to a different agency. ... Some recruiters claim it is only 48 hours. ...
    (comp.lang.cobol)
  • Re: Contracts on Jobserve...
    ... some perfect jobs for me, great chat with the agent, I'm great for the ... Then same job appears two days later, via six different agencies so ... Agency B puts you forward. ... If they're any good they'll phone the client ...
    (uk.consultants)
  • Re: Need help with append query, please
    ... > each client. ... > new agency to all other clients. ... > INSERT INTO tblAgencyAssistance (ID, AgencyAssistance, AssistanceDate, ... > ID AgencyAssistance AssistanceDate AssistanceAmount ...
    (microsoft.public.access.queries)
  • Re: Contracts on Jobserve...
    ... some perfect jobs for me, great chat with the agent, I'm great for the ... Then same job appears two days later, via six different agencies so ... Agency B puts you forward. ... If they're any good they'll phone the client ...
    (uk.consultants)