Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem adding and editing records
Message
De
28/02/2003 08:55:44
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Problem adding and editing records
Divers
Thread ID:
00759345
Message ID:
00759345
Vues:
48
Hi all,

I have just started using VFP and am using VFP8. On one of my tab pages, I have an olecontrol(calendar), which when clicked, populates a grid with specific information relating to that date.

Then, when using the click event of the grid, when i click on a piece of information in a cell, that specific record populates text boxes beside the grid, where I can add or edit new records.

The recordsource of the grid is set to a "tempTable" which is made from the an SQL query and stored using INTO CURSOR tempTable NOFILTER. As this is a tempTable, and local only to the OLEcontrol(calendar), when I click on the grid, the grid is populated with "tempTable" information. When I save or edit this "tempTable" information, I want the newly edited or added information to go into a new table which is stored in my database.

I have tried to write the code for the "add" and "edit" buttons myself, but encountered too many problems, so at the moment I'm using the default buttons and code in the VPF class libraries of "wiztns.vcx".

I understand that in using template code you do not have complete control over what occurs, and I am experiencing a few minor problems.

When I click on the "edit" button, it saves the record no problem, but overwrites the first record! It never changes from this position. I have tried to append a blank and overwrite that with the edited data, but that doesn't work.

And with the "add" button, when I click on add, it automatically saves the data in the text boxes, and also saves the new data I put in. It saves two records. I have tried to get rid of duplicates, but as it saves two records, the first one saved overwrited the last record in the file and the second one saved is just saved normally. Is there anyway to avoid this. Is there a simple way to add records to a table???????

All suggestions, links or code is welcomed. If I have not been clear enough, i will give some of my code. Thanks.

Thanks in advance,
Mick.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform