Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make an editable query when linked to a group by -query

Status
Not open for further replies.

dirkg

Technical User
May 20, 2000
170
BE
I have on the one hand a table with the following two fields:

Task - Simulation_Quantity

Task is the Key.

The I have a group by query that collects for each task the average quantity on a certain period. The outcome of that query gives me also two fields:

Task - Avg_Quantity

whereas there's only one entry in this query per task since I group by task.

However when I link the table with the query on the task-field, I can't edit the Simulation_Quantity anymore :-( Do you know an efficiënt way to achieve this anyway? I tried it with the Unique Records property but that doesn't help. For now I solve it by making a select-query on my Task-table and do a Dlookup in the query with the average quantity to achieve an editable query but I don't think this is the most efficient way.

Thanks a lot in advance for your help.


Greetz,

Dirk
 
Don't join the queries.
Use the In operator to limit the number of records returned by the editable query and you're set

Something like:

Select * From Editable
Where Editable.JoinField In (Select TableName.JoinFieldName From the remainder of the non editable query, starting with From)

Make sure the subquery returns only one field...

That should do the trick.

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
The thing is I do not want to restrict the output of the query, since both queries have exactly the same number of records, namely one for each task. I just want to show the average quantity as information to the user but in such way that he's still able to change the simulation quantity.
So my query should look have the following fields: Task - Simulation_Quantity - Avg_Quantity whereas the field Simulation_Quantity should be editable.

Currently my query looks like:

SELECT TASK, Simulation_Quantity, DLookUp("Avg_Quantity ","qry_Avg_Quantity_Of_Task","TASK = '" & [TASK] & "'") AS Avg_Quantity
FROM TASKS;

This gives me the result that I want but I don't think using the Dlookup-function is the most efficient way to do this but as I said joining the queries gives me an uneditable query.

Greetz,

Dirk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top