Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert a record into a local view by grid
Message
 
 
À
15/04/2001 10:03:16
Fausto Garcia
Independent Developer
Lima, Pérou
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00495551
Message ID:
00495661
Vues:
10
>Sorry for the code formatting, it really looks messy ... how can I give it some style?
>
Use tags < pre > < /pre > without spaces.

>>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
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform