G
Guest
I have a form (Enter Job) with yes/no controls. And in the on click event
for each control I have the following code (example):
Me.Plan = "Landscape Plan"
If LandscapePlanLA Then
DoCmd.OpenQuery "Append Agency1", acViewNormal
DoCmd.OpenQuery "Append Agency2", acViewNormal
Else
DoCmd.OpenQuery "Delete Plan Status", acViewNormal
DoCmd.OpenQuery "Delete Agency1", acViewNormal
DoCmd.OpenQuery "Delete Agency2", acViewNormal
End If
The two queries are similar in fashion and have the following SQL code:
INSERT INTO Agency1 ( Service, [Project Number] )
SELECT Jobs.Plan, Jobs.[Project Number]
FROM Jobs
WHERE (((Jobs.Plan)=Forms![Enter Job]!Plan) And ((Jobs.[Project
Number])=Forms![Enter Job]!ProjectNumber));
I've just recently gone into action queries, and don't know too much about
them. The delete queries work fine, but the append queries don't work
everytime. If I open the form and click on one of the controls, the append
query works. And if I scroll through the records and click on the same
control for a different record it works. But when I click on another
control, with the same coding, it doesn't run the append query, but I don't
get any errors. Any ideas?
Thanks in advance
Neil Cash
for each control I have the following code (example):
Me.Plan = "Landscape Plan"
If LandscapePlanLA Then
DoCmd.OpenQuery "Append Agency1", acViewNormal
DoCmd.OpenQuery "Append Agency2", acViewNormal
Else
DoCmd.OpenQuery "Delete Plan Status", acViewNormal
DoCmd.OpenQuery "Delete Agency1", acViewNormal
DoCmd.OpenQuery "Delete Agency2", acViewNormal
End If
The two queries are similar in fashion and have the following SQL code:
INSERT INTO Agency1 ( Service, [Project Number] )
SELECT Jobs.Plan, Jobs.[Project Number]
FROM Jobs
WHERE (((Jobs.Plan)=Forms![Enter Job]!Plan) And ((Jobs.[Project
Number])=Forms![Enter Job]!ProjectNumber));
I've just recently gone into action queries, and don't know too much about
them. The delete queries work fine, but the append queries don't work
everytime. If I open the form and click on one of the controls, the append
query works. And if I scroll through the records and click on the same
control for a different record it works. But when I click on another
control, with the same coding, it doesn't run the append query, but I don't
get any errors. Any ideas?
Thanks in advance
Neil Cash