Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set focus in grid
Message
From
30/07/2003 05:34:31
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
30/07/2003 04:18:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00814824
Message ID:
00814829
Views:
8
Chaim,

the SUM command moves the recordpointer to EOF(). This will result in LOSTFOCUS, the control bound to the line will lost the focus. But since you are not on a record but on EOF() there is no actual line in the grid so you can not set the focus to a certain control.

try to use SELECT SQL instead.
DIMENSION laResult(1,1)
laResult(1,1) = 0
SELECT;
 SUM(income1.total);
 FROM income1;
 INTO ARRAY laResult

ntotal = laResult(1,1)

RELEASE laResult
HTH
AGNES


>Who can help me?
>1. I have a drid (recordsource is cursor 'income1').
>On the righte column I added the following lines in the 'keypress' event:
LPARAMETERS nKeyCode, nShiftAltCtrl
>if nkeycode=24
>select income1
>	append blank
>This.Parent.Parent.Column1.combo1.setfocus()
>endif
>I want the user will get the focus of the next line by pressing on the arrowdown key (number 46), every thing is good, but the user getting the focus on the right column, how can I give him focus on the left column?
>(As you can see I used with set fucus, but it's not working).
>
>2. I have this lines in method of the form:
select income1
>itotal=income1.quantity*income1.amount
>replace income1.total with itotal
>select income1
>sum(income1.total)to ntotal
>ThisForm.txttotal.value=ntotal
>the problem is that I getting a random message (total 1473 etc) with under line, who is not o.k, I or VFP (I have the line in method who I using with this every lost focus in the grid and after few times my form starting to vanish from all the messages)?
>- By debug I descovered that I gett the bug in this line:
sum (income1.total) to  ntotal
>Thanks in advance
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform