Just catch the error like any other error...

On Error Goto Errorcatch
Dim X as New card
x.show

Exit Sub

Errorcatch:
If Err=7 then
Msgbox "There is not enough memory to display this form"
end if

End Sub