>>I'm using a Grid to display the content of 3 fields
>>from a temporary file. The file is created after the user presses "Add" and only then the grid becomes visible to the user. The temporary file is erased when the user exits the form. The RecordSource and ControlSource properties are changed immediately after pressing "Add" and everything works fine in the first round.
>>
>>However, in the second round, when the I attempt to press "Add" again, the same procedure that worked fine before, fails: Instead of displaying just 3 fields, the grid displays all of the fields of the temporary file in disable colors. It's as if the propgram ignores the same commands it recognized before.
>
>Erez
>
>How are you creating the Temp files?
>
>Tom
Hi Tom,
Here's how:
FUNCTION MakeTempFile
PARAMETERS m_Extension
PRIVATE m_TempName
PRIVATE m_Exist
* PRIVATE m_Extension
PRIVATE m_Directory
PRIVATE __Prefix
__Prefix = ".tmp"
m_TempName = ""
m_Exist = .T.
DO WHILE (m_Exist)
m_TempName = alltrim(SYS(3))+__Prefix
IF (!FILE(m_TempName))
m_Exist = .F.
ENDIF
ENDDO
RETURN (m_TempName)