Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making records read only until ~new entry~ button is pre
Message
 
To
26/06/2000 15:22:03
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00384722
Message ID:
00387862
Views:
18
>I would like to hear some opinions on the best way to use a screen with multiple objects ~textboxes and drop down listboxes sourced to fields within a table~ as a "readonly search engine" for records in the table, but clear all objects and unlock for a new record entry.
>
>I've done this before, but am sure I went around the world to do it.
>
>Thanks
>JD

I don't like to lock onto any data until I'm ready to save the changes. So, I always separate my record display (form) from the record.

I add a Thisform.ShowRecord(), Thisform.SaveRecord() and Thisform.EditType.

In the ShowRecord I fill the objects with the current record. On the form you can have buttons to go thru the file Next/Prev. In this one, I put a copy of the current data in the object's tag (string form). Then, if there's ever a change by the user, I reset the Close button to Save based upon any change.
Then, if the user tries to move off the record or close the form, it runs the
Thisform.SaveRecord.
I recall deleted blanks then or add a new one as needed if EditType is ADD which gets set by the add button that blanks out all the objects for a new record.

If it's an edit, the save function skips the recall or append blank and any unique ID assignments I make on new records.

Be nice if MS has built into a form a DidChange Property that it sets if any of the
object data is changed by the user. Make this a lot easier and save some coding.

Once saved, I reset the Close button caption back to close and the user can
exit if it says close.

The save function only locks onto the record and saves the data and immediately unlocks it. It's like minimal as far as record lock time and
removes any problem of record contention.

As well, I can wrap if statements around the replaces and test the current data
with that existing in the record field. If not changed, don't do replace. If changed, do the replace and save a change data (cText = cText+...) to put into a transaction log.

I've thought about try to build classes to have this all built in. But, haven't gotten around to it.

The only object that I can't use interactiveChange to test the user changes is the Editbox. It makes the thing jumpy. So, I have to use valid on it.
Not what I'd like, but have to make due with what they give us.

I also like to put a grid on a second pageframe and let the user pick a record
by moving thru the grid. I make it readonly so they are forced to do the edit
in the first pageframe page using my edits.

Pageframe just makes the syntax a little longer prose.

If you like this idea. Let me know. dong@warpnet.net

Don Gulledge
Previous
Reply
Map
View

Click here to load this message in the networking platform