CloseWindow isn't closing window

I have a 2 line procedure.

CloseWindow
openform "Entry"

mov

Nothing happens when I trigger this procedure.
I did find that the CloseWindow did work if I removed the following OpenForm “Entry”. But as I really did need the window to close (to resolve an interface problem), more work was needed.

I then tried putting in a delay. Still no luck to get the window to close if I then wanted it back open. Creating 2 separate procedures is what I’ve had to do unfortunately.