Hi All,

I am using following code in VBA to get some records (in my case it is a single record). On Message box line it shows "Invalid use of Null" error, How could I prevent this. Is there any method to know any record is there in recordset or not. As if no record is returned then I want to print "No Match".

***************CODE******************************

Set DB = CurrentDb()

'Get Total Actual Project time from TimeSheet
Actprj = "SELECT (Int(CSng(Sum([Duration])))*24)+Format(Sum([Duration]),'hh') & ' : ' & Format(Sum([Duration]),'nn') AS Expr1" _
& " FROM tbTimeSheet HAVING ((tbTimeSheet.PrjID)='" & Form_TmpInfoPrj.cmbPrj.Value & "')"
Set Rst = DB.OpenRecordset(Actprj)
msgbox Rst.Field(0).value

************************CODE***************************

Regards,
Alankar