Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quick and dirty ADD for dozens of tables
Message
From
06/10/2005 00:21:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/10/2005 00:12:35
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01056606
Message ID:
01056608
Views:
15
>I have dozens of small and infrequently used tables (remote SQL views) that I need a quick way to develop an ADD form. It does NOT have to be pretty.
>
>I thought of haveing a PRG that is called with file number
>Then a Case statement to open correct table.
>
>I hoped I could use only one generic ADD Form.
>Open the database before I call the form.
>Append blank at form load
>Use EDIT command to show fields (this is a new record and not yet updated)
>Put two command button at bottom Save & Cancel
>Save has a tableupdate(), Cancel has Tablerevert()
>Then thisform.release
>
>YES, this is crude but quick to build.

How about a generic form that allows for editing up to, say, 5 fields. You call the form with parameters that indicate the fieldnames (comma-delimited), and the corresponding descriptions (also comma-delimited), and set the properties for the corresponding TextBoxes and Labels in Form.Init().

You could even generate the TextBoxes and EditBoxes on-the-fly; in this case, you don't need to set an arbitrary limit.

>Question: on EDIT command, can I put it on a Form and can I limit user to editing just that one record?

Yes, with
EDIT NEXT 1
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