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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"File in Use" error 2

Status
Not open for further replies.

jtlodi

Programmer
Mar 8, 2002
11
0
0
US
I'm getting a "File in Use" error.

I have a form that opens and obtains a piece of data from the user which is stored in a public variable.

... *** This is code in Form1 which hands things off to a ... *** 2nd form

... PUBLIC Student_id
... Student_ID=(VAL((thisform.list2.Value)))
... thisform.Hide()

... DO FORM forms\student_edit.scx && Second Form

The second form (student_edit.scx) opens and displays data from 3 linked tables. Data is edited and saved properly and the second form closes and disappears.


The programs seem to run just fine but I get a "File in Use" error when I try to modify the Form1 after running it previously.

I suspect that since I just issued a "thisform.hide()" method that form1 is still hanging around in memory ... behind the scenes, so to speak.

How do I make sure the first form closes when the second form closes?

 
Restructure so that form 2 is modal, issue the DO FORM and then thisform.release.

Regards,

Mike
 
this may not solve your problem but just to add some notes:

A1. you cannot have an exclusive use of a dbf if another user on the network has it opened exclusively or shared, or

A2. you cannot even open a dbf as shared if another user on the network opened it exclusively.

B1. you cannot open a dbf if an instance of your app is running (not necessarily visible) and has opened the dbf exclusively and you're trying to open it exclusive or shared, or

B2. you cannot open a dbf if an instance of your app is running (not necessarily visible) and has opened the dbf as shared and you're trying to open it exclusively.

kilroy [trooper]
philippines

"If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get one million miles to the gallon, and explode once a year, killing everyone inside."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top