Hi,

Everytime I run the following function, my screen will display the query result which I do not need. The function result is use by another query.

Function LastID() As Long
'qryProduct is a saved query
Dim lngSourceID As Long
Set rst = CurrentDb.OpenRecordset("Select * From qryProduct where ProductID <> " & lngSourceID & ";")


If Not rst.EOF Then LastID = rst!ProductID
end Function

Can someone help me to swith off the screen display of this query result?
Thanks in advance!

Scott