I think that this should be easy, but I'm having trouble. I'm creating a database for my shooting club. I need to select each shooter's top ten targets from a table. I have a top ten, append query that I'm trying to loop over with a FOR EACH loop. I have a field holding each shooter's ID number in another query. --> SrSt.ShtrID
Here is the query that I'm trying to loop over:
INSERT INTO TopTnG ( ShtrID, Gun, G )
SELECT TOP 10 Targets.ShtrID, Targets.Gun, Targets.G
FROM Targets
WHERE (((Targets.ShtrID)=[Forms]![NameList]![ShtrID]) AND ((Targets.Gun)="Light") AND ((Targets.G) Is Not Null));
The reference '[Forms]![NameList]![ShtrID]' is left over from doing the query from a button on a continuous form.
Any help with this is greatly appreciated. I appologize if this is a stupid or inappropriate question.
Reg999
Here is the query that I'm trying to loop over:
INSERT INTO TopTnG ( ShtrID, Gun, G )
SELECT TOP 10 Targets.ShtrID, Targets.Gun, Targets.G
FROM Targets
WHERE (((Targets.ShtrID)=[Forms]![NameList]![ShtrID]) AND ((Targets.Gun)="Light") AND ((Targets.G) Is Not Null));
The reference '[Forms]![NameList]![ShtrID]' is left over from doing the query from a button on a continuous form.
Any help with this is greatly appreciated. I appologize if this is a stupid or inappropriate question.
Reg999