Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert a record into a local view by grid
Message
From
15/04/2001 10:00:57
Fausto Garcia
Independent Developer
Lima, Peru
 
 
To
15/04/2001 04:44:40
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00495551
Message ID:
00495639
Views:
13
Hi Ransome,

Another idea would be to append a blank record and perform an adequate re-allocation of the existing ones to obtain the required behaviour. For example, let's say you have a local view named your_view, you can try this sequence of code (for example on the CLICK event of a command button inside your form):


LOCAL lcn, loaux

SELECT your_view
lcn = RECNO()
APPEND BLANK
DO WHILE .T.
IF RECNO()=lcn THEN
EXIT
ELSE
SKIP -1
SCATTER NAME loaux
SKIP 1
GATHER NAME loaux
SKIP -1
ENDIF
ENDDO
&& Now you are ready to save the new values
REPLACE field1 WITH value_1, field2 WITH value2, ...
&& You will need to REFRESH the grid in order to show the changes in the grid
THISFORM.your_grid_name.REFRESH
RELEASE loaux, lcn
RETURN


I have tested the code itself and works fine, just adjust it to your particular needs and see if this helps.

Best regards,


>Dear Mike,
>
>Thank you for your hints provided, however, M$ seeems stopping supporting INSERT command some versions sgo! Can you should me the syntax for INSERT command instead?
>
>With regards,
>
>Ransome
Solo se que nada se

Fausto J. Garcia Pino - MCSD.NET
.NET, Oracle, Tronador & Fondismo!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform