Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>>>Help, I have a combo box, when selecting a control I hide the combo and display a text box. The text box is keeping whatever was contained in the combo. How do I clear this text box? I already do a refreash, and the text box does have the same control source as the combo box.
>>>>
>>>>Thank you
>>>>
>>>>
>>>>Holly Clawson
>>>
>>>Holly,
>>>
>>>Why are you doing that? It sound like odd screen behavior... If you define the combobox as a combobox instead of a listbox, you should be able to get the same effect as what you're programming. But, if I'm off the mark..
>>>
>>>Don't use a control source for one of them. Either build an array for your combo, or set the .Value for the textbox programmatically. You should be able to set .Value for the textbox without doing a refresh.
>>>
>>>HTH
>>
>>Matt
>>
>>I agree, the reason for this is I have not been able to figure out how to key new entries into a combo box that has a rowsourcetype of fields. When you say value my value, is already set to none. Do you mean the controlsource type set-up programmatically? I tried that and none of my fields refresh().
>>
>>Thanx
>>
>>
>>Holly
>
>Don't use fields. I have a similar piece of code in my current app, here's how I solved it. If someone thinks I'm doing this ass-backwards, let me know.
>
>I build an array from the field that the combo-box is based on and set the rowsourcetype to 5 and rowsource to the array (THISFORM.aArray). The controlsource is the field. (myTable.fieldA)
>
>In the Valid for the combo, I evaluate the entry with a SELECT fieldA FROM myTable WHERE ALLT(THIS.DisplayValue) = fieldA INTO ARRAY laBuffer. On a single hit, I copy laBuffer to THISFORM.aArray and .Requery() and set .Value to .DisplayValue(1). On a multiple hit, I do the same array copy and give the user the option to select from a short list. On a no hit, I use oApp.doformretval() to call a 'NewRecord' class to enter a new record. (this last step depends on your application). Upon return, I set the .DisplayValue to the returned value (the control source).
>
>For some reason, I couldn't get it to work with a SEEK(). But the functionality turned out to be more straightforward using a SELECT.
>
>HTH
Matt,
I have the array created. When I try to select a new customer the combo stay on the first record. This is not changing at all. What did I miss?
Thank you
Holly Clawson
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