Alexandre
03-01-2001, 08:43 AM
I have a form linked to a table where I need to adapt the control bound to the primary key (reference) according to what the user wants to do:
With the on Clik event I ask the user if he wants to modify the reference or not (just perform Find or Select another record for example) or cancel.
Up to now, the control is a textbox. This was necessary since the Inputmask of the reference is dynamically set (depends on the value chosen by the user in another control).
Now, I would prefer the Textbox to turn into a combo populated with the references through an SQL query when the user doesn t want to modify the reference, so he could go directly to an existing one by choosing in the list.
I manage to do everything BUT programatically change the type of the contol (is ther a property for that ?).
Any help is most welcome!
PS Definitely setting the control as a combo is not satisfactory neither since the OnClik event doesn t work the same at all with combo (only tested after the user has made a choice in the list: too late!) than with a textbox.
With the on Clik event I ask the user if he wants to modify the reference or not (just perform Find or Select another record for example) or cancel.
Up to now, the control is a textbox. This was necessary since the Inputmask of the reference is dynamically set (depends on the value chosen by the user in another control).
Now, I would prefer the Textbox to turn into a combo populated with the references through an SQL query when the user doesn t want to modify the reference, so he could go directly to an existing one by choosing in the list.
I manage to do everything BUT programatically change the type of the contol (is ther a property for that ?).
Any help is most welcome!
PS Definitely setting the control as a combo is not satisfactory neither since the OnClik event doesn t work the same at all with combo (only tested after the user has made a choice in the list: too late!) than with a textbox.