I know I'm straying off topic a little but I'll ask anyway.
My query [QueryDesigner] in Access 2010:
SELECT Max([BoxNumber]) AS HighNumber
FROM Master;
DOES return the highest BoxNumber from the table.
When I do this in VBA I get the first BoxNumber in the table - rather than the HIGHEST value:
. . .
Code:
SQL = "SELECT Max(BoxNumber) AS BigBox FROM [Master] GROUP BY BoxNumber"
With dbsA.OpenRecordset(SQL)
If Not .EOF Then
Box = !BigBox
End If
.Close
End With
MsgBox "In AddNextBoxNumber(). Highest Box Number = " & Box
Any ideas what's going wrong?
Thanks,
Robeen