Run-time Form fails to stay up when using Read Events

Hi,
I am trying to add a run-time form to an exisiting VFP 7 application where the READ EVENTS is executed higher up in the program.
My problem is my form does not pause execution and allow for user input. The form appears, with the grid fully populated for a moment and then clears and my program ends.

Here is my code:

SELECT user, id FROM users.dbf ORDER BY 1 INTO CURSOR ac_users
  =l_doform()
ENDIF
RETURN

******************************************
FUNCTION l_doform

GO TOP
lof = CREATEOBJECT("UserList")
lof.visible = .t.
lof.show()

DEFINE CLASS UserList as Form

  PROCEDURE init()
    WITH THIS
      .Caption = "User List"
       
      .ADDOBJECT('cmdCancel', 'cCancel' )
      .cmdCancel.VISIBLE = .T.

      .AddObject("grid1","grid")
      .grid1.visible = .t.
      .grid1.readonly = .t.
    ENDWITH
  ENDPROC

ENDDEFINE

DEFINE CLASS cCancel AS COMMANDBUTTON
  CANCEL = .T.
  CAPTION = "Exit"
  HEIGHT = 25

  PROCEDURE init()
    this.TOP = thisform.HEIGHT - this.HEIGHT - 5
    this.LEFT = thisform.WIDTH - this.WIDTH - 5
  ENDPROC
     
  PROCEDURE CLICK
    THISFORM.RELEASE()
  ENDPROC
ENDDEFINE

******************************************
*END FUNCTION l_doform
******************************************
jinfeldPresidentAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pcelbaCommented:
What's wrong with the already published solutions? (See http://social.msdn.microsoft.com/Forums/en-US/visualfoxprogeneral/thread/1ab40520-11f2-4203-a332-a05b101ee247 for more details.)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jinfeldPresidentAuthor Commented:
I had no idea these forums were linked and I couldn't find my earlier posting using the "search" feature. Thanks for your help! That worked!
jinfeldPresidentAuthor Commented:
Thank you Pavel and Tom!
pcelbaCommented:
These forums are not linked just some people are "shared" :-)

Anyway thanks for the points!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FoxPro

From novice to tech pro — start learning today.