Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Performance (Design) Question For VFP Apps 1

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
I'm involved in a philosophical discussion with a friend on design techniques.

In your opinion, is it better to link your text boxes directly to the fields on your form via the controlsource property or use scatter/gather techniques to edit data?

1) Which technique is faster?

2) Which technique is preferred (more advantageous)?
The 2nd mouse gets the cheese.
 
is it better to link your text boxes directly to the fields on your form via the controlsource property or use scatter/gather techniques to edit data?

Your second choice implies that the textboxes use memory variables. There is actually a third choice: not binding the textboxes to anything, and using their .Values at save time.

Probably the approach that gives you the most flexibility and data reliability, and that can be used for both local and remote data, is to have buffered view with the textboxes bound to the view's columns, then issuing TableUpdate() or TableRevert() as needed. The advantages include:

* easily switchable from local to remote data
* works well with multiple instances of the form(s) open at once
* works well with simulataneous multiple user access (though you may need to write some conflict resolution code).

That probably answers your #2 question (I'm saying that this is probably the Microsoft party-line preferred method, though I often do not use it for various reasons).

As to which is faster, I think that must take a backseat to usability and reliability issues, at least in this case. I say this because one method may different from another by only fractions of a second, and in an end-user environment (as opposed to batch updates) this difference will be meaningless. Robert Bradley
Got extra money lying around? Visit:
 
drosenkranz

There is actually a third choice: not binding the textboxes to anything, and using their .Values at save time.

One example of the benefit of this approach is in data entry validation.

Assume you have a data entry form with both OptionGroups and CheckBoxes and you want to determine visually, and in code, as to whether a user has passed through the controls.

As both controls use logical values, using a controlsource determines a default value which may or may not be correct, and it's difficult, but not impossible, to detect if the value was or was not changed.

Remove the controlsources and the optiongroups can be given an initial value of 0, (no selection) and the checkboxes an initial value of 2, (dark grey tick on grey background).

"Passing through" either type of control has to change their value.

Thus, using a record validation routine called by a "Save changes" cmdbutton, a user can be returned to a control for action should they have skipped it during data entry.

Chris :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top