Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I really need some help.
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00146391
Message ID:
00146402
Vues:
33
>>Hello,
>>
>>Im in the middle of making a program and ran into a problem.
>>
>>What I have is a table named "Address" , it contains the fields ,
>>
>>Name
>>Address
>>City,State
>>P.O Number
>>
>>On my main screen named "Msa_main" , where the "Address" table is located I have 'Name' as a combo drop box.
>>
>>Now what I want it to do is :
>>
>>when you enter a name and hit tab ( or whatever key ) if it exists in
>>"Address" fill in the 3 other fields . It does this part great.
>>
>>The problem Im having is when there's a name that dosent exist and you
>>type in a new name , it's not storeing it in the list box , or in the database , it's storing the new 'Address',CityState,P.o Number' but not the 'Name' field.
>>
>>I would be very happy if someone could clue me in on how to get this working .
>>
>
>I'm thinking you have some kind of search [seek] to see if a record exists. If it does not, you are doing an append blank to add the new record, and because the other textboxes are bound to the fields in the table, their data entries are being saved. The problen is your combobox is not bound to the NAME field in the table. So you have to do a REPLACE NAME WITH the DisplayValue typed in the combo box.

To be more explicit, add the following code in the combobox method where your existing code is that does the seeking for a current record match [probably in the LostFocus method]:
if not eof()
   ** whatever code you have here should be fine
else
   append blank
   replace name with this.displayvalue
endif
thisform.refresh()
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform