Set Focus on a particular field in a form

Posted on 2004-10-25
Last Modified: 2006-11-17

I have a field in a form that after update it will chek the UM on whatever they enter on the item field and display it in the UM field but when they enter a invalid item it will pop a message "not valid item" and the next step is ITEM.Setfocus to the item field so they can enter the right one but with that it jumps to the next tab field. it seems the SetFocus doenst work.

Any suggestions on how to handle this is appreciated.

Question by:tvae
    1 Comment
    LVL 18

    Accepted Solution

    put the check in the before the afterupdate, the data has already been changed.

    if the data isn't valid, set the cancel = true...the focus will stay on the field.  

    Use the before update for the field you wish to check.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: MongoDB Object-Document Mapper for NodeJS

    NodeJS (JavaScript on the server) is awesome, but some developers get confused about NoSQL when it comes to working in Node with MongoDB (NoSQL database). Do you need a better explanation of how to use Node.js with MongoDB? The most popular choice is the Mongoose library.

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

    913 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

    13 Experts available now in Live!

    Get 1:1 Help Now