>Hi all,
>
[quoted text clipped - 18 lines]
>Thanks,
>Bonnie
I assume that you have some number, say "InsuranceNr", that gives the
order of the most recent entries.
I would use three queries.
The first, called "qry_Top3", returns the mos recent 3 entries:
SELECT TOP 3 tblInsurance.Carrier
FROM tblInsurance
GROUP BY tblInsurance.Carrier
ORDER BY Max(tblInsurance.InsuranceNr) DESC;
The second query, called "qry_Rest", gives the other carriers:
SELECT DISTINCT tblInsurance.Carrier
FROM tblInsurance
LEFT JOIN qry_Top3 ON tblInsurance.Carrier = qry_Top3.Carrier
WHERE qry_Top3.Carrier Is Null
ORDER BY tblInsurance.Carrier;
The third query, used as the record source of he combo box, is the
union of the firs two:
SELEC Carrier FROM qry_Top3
UNION ALL
SELEC Carrier FROM qry_Rest;
Of course, you will have to requery the combo box on the OnCurrent
event.
HTH
Mathias Kläy

Signature
www.kcc.ch
Larry Linson - 06 Jun 2006 06:58 GMT
I believe you need to remove the Max function from the OrderBy in the first
Query.
Larry Linson
Microsoft Access MVP
>>Hi all,
>>
[quoted text clipped - 50 lines]
> HTH
> Mathias Kläy
Matthias Klaey - 06 Jun 2006 08:42 GMT
No, the Max funcion is essential. If you remove it, you get the error
"You tried to execute a query that does not include the specified
expression 'tblInsurance.InsuranceNr' as part of an aggregate
function".
To see how this query works, consider
SELECT TOP 3 tblInsurance.Carrier, Max(tblInsurance.InsuranceNr)
FROM tblInsurance
GROUP BY tblInsurance.Carrier
ORDER BY Max(tblInsurance.InsuranceNr) DESC;
This is the same query, except that here the Max is shown in the
output.
Greeings, Mathias
>I believe you need to remove the Max function from the OrderBy in the first
>Query.
[quoted text clipped - 56 lines]
>> HTH
>> Mathias Kläy