Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defaulting a combo box to a specific value?
Message
 
À
27/06/2000 14:24:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00385055
Message ID:
00385489
Vues:
13
>>>>>>>I am populating a drop down combo from a query with a customer ID code to a cursor. At every location, there is a customer code of "CASH-"+locationcode. Is there any way to make the drop down default to the "CASH-"whatever ID in every case?
>>>>>>
>>>>>>Did you try Thisform.ListBox1.Value = "CASH-"+locationcode in every case?
>>>>>>
>>>>>>>Thanks
>>>>>>>
>>>>>>>Jim
>>>>>
>>>>>Jess,
>>>>>
>>>>>Er, actually, no. I did try .value="CASH" in the combo's init with zero results. I'll cobble together the complete string and give it a go.
>>>>>
>>>>>Thanks.
>>>>
>>>>Well, no luck with either the form's on the combo's init. Could this be bcause of when the query is run? Would the InteractiveChange be a better place to set the .value? I am still very weak on the event sequence on this form. Any more ideas would be greatly appreciated.
>>>
>>>Try to make your RowSourceType as SQL and your RowSource = "Select 'Cash-'+table.locationcode As "Location" Into Cursor loccursor.
>>>
>>>Thisform.ListBox1.Requery()
>>>Thisform.ListBox1.Value = loccursor.locationcode
>>
>>Sorry for typo error. Correct the syntax:
>>
>>Thisform.ListBox1.RowSource = "SELECT 'CASH-'+table.locationcode As "location" From table INTO CURSOR loccursor
>>Thisform.ListBox1.Requery()
>>Thisform.ListBox1.Value = loccursor.location
>>

>Good thoughts, but I muscled my way through it. My main form calls a number of modals that wind up updating the main form. I got caught up in a refresh() frenzy. I cleaned up all the extra refreshes, added a locate for the "CASH-"+location into my cursor in the WHEN method of the combo, then set the combobox.DisplayValue with the result. Works beautifully. Thanks for the prod - it got me looking closer at the event sequence and helped me clean up a lot of extraneous code. And sharpen up my skills using the Debugger.
>
>How are things in Manila? Used to live and work in a little town called San Antonio in Zambales province in the mid '80's. Loved it - until monsoon season.
>

Manila is fine and Subic as well. Oh yeah! Olongapo City, Zambales is one my favorite place in the Philippines because of its cleanliness.

See you in California soon.
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform