Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to solve this problem?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00436556
Message ID:
00437128
Vues:
30
Hi Usha,
Let's see if I understand...
You have a form (form1) On form1 is a TextBox (let's call it txtLocationCode) where a location code is entered. This location code needs to be a new (unused) code. Also on form1 is a CommandButton with the following code:
vlocation = location_code
USE ("c:\mine\land.dbf")
IF vlocation != land.location_code
   DO FORM ("c:\mine\land.scx")
ELSE
   DO FORM ("c:\mine\errorcode.scx")
ENDIF
RELEASE thisform
Is that correct?

If so, what I need to know is this:
What is the ControlSource of txtLocationCode? (Pardon me if the following is obvious, but...) When you go to the PropertySheet and select txtLocationCode (or whatever you named the TextBox), what (exactly) is in the ControlSource entry? Is it location_code? If so, this MAY be the problem. If the textbox is being used for a lookup, it can't be bound to a table or view, it should be bound to a persistant variable, for example, a form property.

To do that, you would go to the Form menu, choose New Property, and add a property like LocationCode.
Then, you would change the ControlSource to ThisForm.LocationCode.
And you would change the CommandButton code to
vlocation = ThisForm.LocationCode
USE ("c:\mine\land.dbf")
if !seek(vlocation, "land", "loc_code")
   DO FORM ("c:\mine\land.scx")
ELSE
   DO FORM ("c:\mine\errorcode.scx")
ENDIF
RELEASE ThisForm
This ASSUMES that you have an index on location_code with a tag of loc_code in your land table.

HTH,
Bill Armbrecht
VFP MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform