Information générale
Catégorie:
Codage, syntaxe et commandes
With Michel F., use AFields() to get a list of fields. But it sounds like you need a little more than that, unless the user can't leave ANY fields blank. In this case, the easiest thing to do is to have your standard m_Save method on your base form class call a standard m_ValidSave method. The particular form may leave the m_ValidSave blank, or use it to validate particular forms. If you want to do it more generally, you could add properties to fields linked to a data dictionary like Stonefield's (SDT). These properties can be, say,
f_nAllowBlank && 0 = yes, 1 = no way, 2 = Warning only
f_nAllowDup && Allow duplicates of this field, 0=yes, etc.
f_cDupIndex && Tag to search to test for duplicates
And so forth. Then you use AFields(), and scan the array in m_ValidSave. You get SDT to return the value of f_lAllowBlank for every field in AFields(), and to return a nice name for the field to use in your warning message.
Adam
*********
>Hello everyone, me again...
Is there a way to get a list of fields from a table?
What I would like to do is as follows:
on the save button, check all fields on the form and see if any of them were left blank and based on
this inform the user that so and so field can not be left blank.
Or is there any other faster and/or easier way with VFP5?
BTW: the input goes on in a grid.
thanx in advance
alfred
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement