Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EXE File Will Not Run
Message
From
15/07/2005 21:24:57
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
15/07/2005 09:26:36
Herman Sanders
Department of Workforce Services
North Little Rock, Arkansas, United States
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01031262
Message ID:
01033257
Views:
20
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform