• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1085
  • Last Modified:

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

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.
Lou Dufresne
Lou Dufresne
1 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now