Okay...I'm lost. Tried to set up a query using in SQL view using the above suggestion. Even cut & paste in case of typing errors and editted the existing query info as needed.
dim SQLString as string
dim db as database
dim Rec as recordset
dim CarClass as string
dim Place as integer
SQLString = <SELECT Cars.Class, Classes.[Class Description], [Score Cards].[Car#], Cars.Placing, Sum([Score Cards].Total) AS [Total Points], Cars.Year, Cars.[Car Manufacturers], Cars.Model, Cars.Style, [Mailing List].[First Name #1], [Mailing List].[Last Name #1], [Mailing List].[First Name #2], [Mailing List].[Last Name #2]FROM Classes INNER JOIN (([Mailing List] INNER JOIN Cars ON [Mailing List].[ID#] = Cars.[Owner ID#]) INNER JOIN [Score Cards] ON Cars.[Car#] = [Score Cards].[Car#]) ON Classes.[Class ID] = [Score Cards].Class
GROUP BY Cars.Class, Classes.[Class Description], [Score Cards].[Car#], Cars.Placing, Cars.Year, Cars.[Car Manufacturers], Cars.Model, Cars.Style, [Mailing List].[First Name #1], [Mailing List].[Last Name #1], [Mailing List].[First Name #2], [Mailing List].[Last Name #2]
ORDER BY Cars.Class, Sum([Score Cards].Total) DESC;>
set db = currentdb()
set Rec = db.OpenRecordset(SQLString, dbDynaset)
' This stores the result in the querry and is updateable
Placing = 1
CarClass = Rec!class
while not Rec.EOF
If Rec!class <> CarClass then
Carclass = Rec!class
Placing = 1
end if
if placing < 3 then
Rec!Place = Place
Placing = Placing + 1
end if
Rec.MoveNext
wend
When I tried to view this query...got an error message saying that it is an invalid SQL statement. I toyed with different versions and got no where.
You had suggested using this as a button, but really have no place to put the button yet. Have not set up the switchboard until I know exactly what to name everything. Have learned from past experiences to not create the switchboard(s) until the last step as continually changing names can cause problems if I forget to update the switchboard.