Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Control - Append a new record in the last grid row
Message
From
10/11/1998 15:05:22
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00156026
Message ID:
00156328
Views:
34
>>>I've ended up using the COUNT... function in the grids .When event and in my >custom Form.DeleteRec event. If 0 then I APPEND.
>>
>>Be careful with COUNT, it moves the record pointer. For many apps this is annoying if not dangerous...
>
>Like I said, I'm not totally happy with this approach but it's all I can come up with for now and because I'm deleting records I can't use RECCOUNT so basically I do the following:
>
>ThisForm.LockScreen=.T.   prevents the visual annoyance
>mnrec=RECNO()
>COUNT......
>GOTO mnrec
>ThisForm.LockScreen=.F
>
.
>
>Thanks for all the ideas.

Colin - I didn't mention that in my original post but what I do to avoid moving the pojnter at all is as follows
lcoldalias = ALIAS()
USE polines AGAIN IN 0 ALIAS countlines
SELECT countlines

COUNT FOR countlines.idnumber = thisform.idnumber.value TO lnreccount
SELECT (lcoldalias)
USE IN countlines

IF lnreccount = 0
     *** Insert stuff here
ENDIF

*** Refreshes and so on
I am copying this to Erik. HTH
***************************
Bruce Gilmour

"Two things are infinite, the Universe and human stupidity. And I am not sure about the Universe."
- Albert Einstein
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform