Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need help with my Program
Message
De
08/09/1998 19:56:59
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00134231
Message ID:
00134281
Vues:
13
Another option is to use a parameterized view for your control source.
Create a view of your table named, for instance, v_Customer
In the filter condition set the value of the name field to ?cViewParm

Set the NoDataOnLoad property of the view cursor to .T.
This also works best if you set the form's buffermode to 2 - Optimistic Row.

You will have to start with a new blank record, so in the init of the form
APPEND BLANK IN v_Customer

In the valid method of the name text box do something like:

*--The variable has to be private so it will be in scope when you
*--requery the view
PRIVATE cViewParm
cViewParm = THIS.Value

REQUERY('v_Customer')

*--You need to add a blank record at this point
*--if there were no matches in the name field
IF _TALLY = 0
APPEND BLANK IN v_Customer
RETURN .F.
ENDIF

When the user (it sounds like that's you) presses enter in the Name field, you get your record if it is there. Otherwise you have a blank record in which to enter a new customer. You have to use the TABLEUPDATE() function in your save method to write the information in the buffer to the actual table on disk.

HTH

Pamela
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform