>I have a form with a grid which contains the APPOINTMENTS table.The records which are deleted from the APPOINTMENTS table are saved in the BACKUP table by the command:
>
>SCATTER MEMVAR
>INSERT INTO backup FROM MEMVAR
>PACK
>
>When I issue the command to see the backup table in a BROWSE Window:
>
>USE backup IN 0
>BROWSE NORMAL NOWAIT
>MOVE WINDOW backup CENTER
>
>VFP says file is in use and does not open the BROWSE Window.
>Backup is a free table.How do I open the Browse window with the said Backup table in the APPOINTMENTS form.
>Thank You All
>Zaraq Bari
Zaraq,
Change you code from;
USE backup IN 0
BROWSE NORMAL NOWAIT
MOVE WINDOW backup CENTER
to;
IF USED("Backup")
SELECT Backup
ELSE
SELECT 0
USE Backup AGAIN ALIAS Backup
ENDIF
BROWSE NORMAL NOWAIT
MOVE WINDOW backup CENTER
You have tow problems in the existing code, 1) you don't account for the possibility that the backup file is already open somewhere and 2) the IN 0 option DOES NOT make that work area current.