
I want to get Projid from this lookup field and use for comparison
Look at whether the form control is bound to a data source field. If so, use the data source and field name to access the value: table1.ProjectId
If it's an unbound control, make sure that it has AutoDeclaration=Yes and then refer to it by name: ProjId.text().
It could also be bound to an edit method - you would call the method from your code in such a case.
If you need more help, please tell us which form you're talking about and at what point you want to do the comparison.