Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EXE File Will Not Run
Message
De
15/07/2005 21:24:57
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/07/2005 09:26:36
Herman Sanders
Department of Workforce Services
North Little Rock, Arkansas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01031262
Message ID:
01033257
Vues:
21
>Could you help me with this: What is the code I put on a control button on a form to add a record, and what is the code would I use to then save the record?

To add a record, you may first want to check whether there are changes to the current record; if there are, ask the user if he wants to save. The same checks should be done before many other actions, such as next record, previous record, close form, etc. All this can be done in one or more form methods.

Apart from this, to add a record you need:
append blank
To save a record (assuming you already have buffering enabled):
if not TableUpdate()
  aerror(MyErrorArray)
  MessageBox("Error saving record; Error #" + trans(MyErrorArray(1));
    + " - " + MyERrorArray(2))
endif
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform