UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Is It Possible To Change Multiple Combo Boxes To Text Boxes Using A Macro Or Vba?, Access 2013    
 
   
freespiritcheris...
post Sep 13 2019, 03:49 PM
Post#1



Posts: 150
Joined: 19-October 04



I have loads on a form and its just easier to type my value in rather than looking up. I've looked online, I can imagine that this, Application.RunCommand acCmdChangeToTextBox might do something useful, but I don't know how for bulk!

thanks.gif in advance wine.gif
This post has been edited by freespiritcherishes: Sep 13 2019, 03:52 PM
Go to the top of the page
 
DanielPineault
post Sep 13 2019, 04:36 PM
Post#2


UtterAccess VIP
Posts: 6,899
Joined: 30-June 11



Probably use something like
CODE
Function SwitchCbo(sFormName)
    Dim frm                   As Access.Form
    Dim ctl                   As Access.Control
    Dim sCtlName              As String

    DoCmd.OpenForm sFormName, acDesign
    Set frm = Forms(sFormName).Form
    For Each ctl In frm.Controls
        If ctl.ControlType = acComboBox Then
            sCtlName = ctl.Name
            ctl.InSelection = True
            Application.RunCommand acCmdChangeToTextBox
            Set ctl = frm.Controls(sCtlName)
            ctl.InSelection = False
        End If
    Next ctl
    DoCmd.Close acForm, sFormName, acSaveYes

    Set ctl = Nothing
    Set frm = Nothing
End Function

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
theDBguy
post Sep 13 2019, 06:29 PM
Post#3


Access Wiki and Forums Moderator
Posts: 76,380
Joined: 19-June 07
From: SunnySandyEggo


You should still be able to type into a combobox, you don’t have to look it up. So, there’s really no need to convert them, unless you really just want to.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
DanielPineault
post Sep 13 2019, 07:06 PM
Post#4


UtterAccess VIP
Posts: 6,899
Joined: 30-June 11



QUOTE
You should still be able to type into a combobox, you don’t have to look it up. So, there’s really no need to convert them, unless you really just want to.

Really good point theDBguy.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
freespiritcheris...
post Sep 26 2019, 02:37 PM
Post#5



Posts: 150
Joined: 19-October 04



Hi Daniel,

Thank you for that... I shall have a play. In the end I just entered manually as DB pointed out... the aim was to reduce the space taken up on the form/screen so thanks.gif for that.

Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    15th October 2019 - 04:11 PM