Change Control Type

brsawvel

Registered User.
Local time
Yesterday, 22:31
Joined
Sep 19, 2007
Messages
256
Hello,

I tried writing code to change the control type of a field in a form, but to no avail.

Here's what I wrote....
Code:
 If Me.fldAnswerType = "Select" Then Me.fldAnswer.ControlType = acCombobox

But that is only part 1 of the problem. Part 2 is the following:

fldAnswer is an unbound text box in its original format.

What I want is to turn fldAnswer into a combo box when fldAnswerType has a value of "Select"...and then I want the fldAnswer combo box to populate with all records from fldAnswer.tblAnswers Where fldQuestion matches Me.fldQuestion...

Does this make sense? Can someone help?
 
Sorry to ask, but why would you do this? For one, it is not as simple as you think it might be. You would need to open the form in design view to do the changes (which means you would never be able to use this as an MDE).

So, why not just have a combo and a text box on the form and DISPLAY what you want when you need it.
 

Users who are viewing this thread

Back
Top Bottom