Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

READ EVENTS Doesn't stop processing .. The First Time

Status
Not open for further replies.

AlanArons

Programmer
Aug 1, 2002
91
US
I have an app that runs fine in development but not when it is compiled to an .exe

In a button (form1.button) click method, I call another form (form2) with data in a grid. The user selects a record from the form2.grid and double clicks which closes form2 and inserts the selected data in form1. This process is repeated until all desired lines are selected

When I compile this, the first time form1.button is clicked and form2 data selected, the selected data is not inserted in form1. If you click form1.button again (and each time thereafter), it works fine.

I have a READ EVENTS statement immediately after my DO FORM form2 statement.

It appears that the first time I run the form1.button.click method, the READ EVENTS does not stop the processing while waiting for the DO FORM form2. After the first time the READ EVENTS does.

Does anyone have any insight into this.

Alan Arons [ponder]
 
Alan,

You don't want READ EVENTS after DO FORM Form2.

You should only have (at most) one READ EVENTS in the app, and it should appear after the command that launches the "top level" user interface, that is, the main controlling menu or form.

If you want to allow Form 2 to pass information back to Form 1, you should make it modal. (You might already have done that, in which case removing the READ EVENTS should solve the problem.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks Mike.

Removing the Read / Cancel Events fixed the problem.

Alan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top