You can index a field even if it is null but you can't change it to required unless any existing rows are populated.
@hfsitumo2001, it is always better to use RI to enforce rules than to use code. RI works no matter what, code only works if you run the form that includes the code. So, if you set a unique index, you can't add a duplicate with an append query. And if your BE is shared by multiple apps, the rule is enforced in every app that links to the table.