MS Access - Move focus from one form to another form with VBA and enable controls

Posted on 2009-12-28
Last Modified: 2013-11-28
I have a form  titled "F-100-05" .When I click a button on this screen I want to move to another form "F-100-04" and then enable the following fields on this form ( F-100-04), "Pu-VIN", Pu-Year".  
I do not have the correct syntax to do this.
How do I write the VBA code to do this.
Question by:Lou Dufresne
    1 Comment
    LVL 77

    Accepted Solution

    If form " is open then do..

    Forms![F-100-04].[Pu_vin].enabled = true
    Forms![F-100-04].[Pu_year].enabled = true
    Forms![F-100-04].[Pu_vin].setfocus  ' or wherever you want the focus

    If the form is not open you will need an extra first line..
    Docmd.Openform "F-100-04"

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now