Why do you want to change the field type?
Create a text box and a combo box, one on top of the other, and set the
visiblity of each one of then
Me.TextBox.Visible = (Condition)
Me.ComboBox.Visible = Not (Condition)
So it will alwys set one to visible True and the other to False

Signature
Good Luck
BS"D
> --------------------------------------------------------------------------------
>
[quoted text clipped - 6 lines]
>
> any thoughts???
Hi Jay,
Why not just create two controls and show/hide them based on your needs?
CW
> --------------------------------------------------------------------------------
>
[quoted text clipped - 6 lines]
>
> any thoughts???
jay - 31 May 2007 18:20 GMT
that's what i currently have, which will work fine. just was curious to see
if i had the code wrong.
> Hi Jay,
>
[quoted text clipped - 12 lines]
> >
> > any thoughts???
Cheese_whiz - 31 May 2007 18:39 GMT
Hi Jay,
What you appear to be attempting is actually changing the control type of a
SINGLE control back and forth depending on your needs. What I'm suggesting
(as well as the poster above me) is that you just go ahead and make TWO
controls, one of each kind (one textbox, one combo box), stack them on top of
each other so they sit in the same place on your form, and use the 'visible'
property (of each of them) to hide one and show the other one depending on
what you need.
CW
> that's what i currently have, which will work fine. just was curious to see
> if i had the code wrong.
[quoted text clipped - 15 lines]
> > >
> > > any thoughts???
Jay, Here's an actual example of modifying a form via VBA in design mode:
DoCmd.OpenForm "frmInputBox", acDesign
Forms!frmInputbox!lstZip.RowSource = "SELECT Zip, City, St, ZipID FROM
tblZipcode " _
& "WHERE tblZipcode.Zip=fcnZipArg(2);"
DoCmd.Close acForm, "frmInputBox", acSaveYes
DoCmd.OpenForm "frmInputBox"
HTH, UpRider
> --------------------------------------------------------------------------------
>
[quoted text clipped - 6 lines]
>
> any thoughts???
Douglas J. Steele - 01 Jun 2007 00:02 GMT
That's how to modify the RowSource. RowSource can be modified that way.
Jay's wanting to modify the ControlType of a control. That can't be done
unless the form is open in design mode. Of course, I can't see any reason
why you'd want to change it programmatically. If sometimes you need a text
box and sometimes a combo box, put both on the form, and only make one
visible at a time.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Jay, Here's an actual example of modifying a form via VBA in design mode:
> DoCmd.OpenForm "frmInputBox", acDesign
[quoted text clipped - 17 lines]
>>
>> any thoughts???
UpRider - 01 Jun 2007 00:12 GMT
Doug, I believe my code does open the form in design mode. He would
substitue his code for the rowsource code, which is only for example.
The steps are (all via VBA):
Open the form in design mode
Make the changes
Save the form with changes
Open the revised form
UpRider
> That's how to modify the RowSource. RowSource can be modified that way.
>
[quoted text clipped - 26 lines]
>>>
>>> any thoughts???
Douglas J. Steele - 01 Jun 2007 00:44 GMT
Sorry, you're right: it is opening in Design mode.
I still don't understand the requirement to change the control type
programmatically!

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Doug, I believe my code does open the form in design mode. He would
> substitue his code for the rowsource code, which is only for example.
[quoted text clipped - 38 lines]
>>>>
>>>> any thoughts???