Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus
Message
From
16/05/2006 03:29:06
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01121830
Message ID:
01122131
Views:
16
hi,
thank you,
i try via event click, i try return 0 and return 2,
i got the MESSAGEBOX(" file exists"), avery time if exist or not, and return to my text.
m.PathToFile1 = "z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\"
lcSearchFile1 = m.PathToFile1+"main2" 
IF FILE(m.lcSearchFile1+".dbf")
 USE main2 
select main2
GO TOP IN main2    
IF NOT EOF("main2")

    gcDelimName = ALIAS( ) + '.xls'
    gcPath = [w:\Quality Test 01\mtest\]
    gcDelimName =  gcPath +   DTOS(file_date) +  ".XLS"

    lcFile=gcDelimName

    if adir(dummy,lcFile)>0
        MESSAGEBOX(" file exists")
        THISFORM.TEXT1.SetFocus()
       * RETURN 0  && 
        return 2
    else
        COPY  TO (gcDelimName) XL5
    ENDIF
 endif
********************************************
insert INTO mstr ;
               SELECT * FROM main2 WHERE file_date NOT IN (SELECT file_date FROM mstr)
*******************************************************
   DELETE FILE(m.lcSearchFile1+".dbf")
   DELETE FILE(m.lcSearchFile1+".cdx")
   DELETE FILE(m.lcSearchFile1+".fpt")
ENDIF 
******
SET DEFAULT TO [w:\Quality Test 01\Source Data]
thisform.text9.Value=GETFILE('xls')
CREATE TABLE [z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\main1.dbf];
(msisdn n(15),num n(8),date d(8) ,flag n(2),pstn n(3) )
APPEND FROM (thisform.text9.Value) TYPE xl5
Replace Date  with thisform.text1.value ;
        flag   with 0 ;
        pstn WITH 0;
               num with RecNo() ALL


*********************************************
CREATE TABLE [z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\main2.dbf];
(num n(8),survey_num n(2),msisdn n(15),file_date d(8) ,intervdate d(8),status n(2),othersst c(100),con_type c(20) )               
*************************************************
SET DEFAULT TO ([w:\Quality Test 01\Source Data\])
COPY FILE (thisform.text9.Value ) TO [w:\Quality Test 01\mtest\]+(JUSTFNAME(thisform.text9.Value ))
SET DEFAULT TO ([w:\Quality Test 01\Source Data\]
ERASE (thisform.text9.Value).xls
i get the message , if exixst or not and stay at
>Then I'm not surprised <g> You can not call SetFocus from Valid event, it's said in the Help. You can use return 2, for example, to set focus to the object, which would be 2 objects forward in TabOrder sequence.
>
>>hi,
>>thank you for reply,
>>
>>this is the all code via event valid,
>>but not works......i think...rong bosition
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform