In Access, is there a command to go to a control in design view from a command button?

In Access, is there a command to go to a control in design view from a command button?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
sorry, but none. You can put the form in design view from a command button click with

docmd.openform, acdesign
What are you trying to do?
dailymeatAuthor Commented:
Want to open form in design view, go to a command button,  property event
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

OK, we got that much.  What do you want to do at that point?  Why do you have to put focus on the control?  Once the form is open in design view, you should be able to reference any control directly.   Keep in mind that Access is a Rapid Application Development tool intended for use in creating data-centric applications.  It isn't a graphic design tool so there is a limit to what you can actually do programmatically in design view.

Are you making a tool for yourself because this is not something you would ever do in an application you built for others to use.
Rey Obrero (Capricorn1)Commented:
my post at #a42041204  already answered your question.
Jeffrey CoachmanMIS LiasonCommented:
If I am understanding your request here correctly, ...You can try code like this perhaps:
(It worked for me, ...again, ...If I am understanding your request here correctly)

Private Sub Command13_Click()
    DoCmd.OpenForm "YourForm", acDesign
    Forms![YourForm]![CustName].InSelection = True
End Sub

Sample db attached

Not sure why you would need to do this...?
Also note that this will NOT work in a Runtime


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dailymeatAuthor Commented:
It worked!, thank you
Jeffrey CoachmanMIS LiasonCommented:
Thanks, took me a while to get the syntax just right.

Just note the cautions we all mentioned...

Rey Obrero (Capricorn1)Commented:
that is nice. learned something new today ;-)
Jeffrey CoachmanMIS LiasonCommented:
Cap, ...Yeah, ...
For some reason, years ago, I remember a question on this, ...I think Scott posted the syntax...
I was not even certain the syntax still worked...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.