Dim rsDim sql sql = "select count(addressid) from address where entityid = '" & CurrentID & "'" Set rs = Application.GetNewConnection.Execute(sql) If Not rs.EOF lblAddressCount.Caption = rs.Fields(0).Value & " addresses" End If rs.Close Set rs = Nothing