1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access SETFOCUS question

Discussion in 'Business Applications' started by ABAPer, Sep 17, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. ABAPer

    ABAPer Thread Starter

    Joined:
    Sep 14, 2004
    Messages:
    9
    In the course of programming a timesheet, I must tally both columns and rows for total hours. I would like to tally these numbers as the hours are being entered. But in order to achieve this, I placed the code in the AFTERUPDATE event requiring that I SETFOCUS many times. The problem is...I don't know where the true SETFOCUS should be when I'm done. The AFTERUPDATE event is triggered on Enter, Tab or Cursor movement. Is there a way to capture the intended next field during an AFTERUPDATE event?

    Thanks,

    Ken
     
  2. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    If the form or report element has a name you can set the focus to any of these items using Afterupdate. You can also write a procedure that will run and once it finishes you can set the focus anywhere you like.
     
  3. ABAPer

    ABAPer Thread Starter

    Joined:
    Sep 14, 2004
    Messages:
    9
    Setting Focus is not the problem. The problem is trying to figure what field the user clicked one in the AFTERUPDATE event.

    I have a subform when 10 rows and several columns for the days of the week. I want a total at the end of each row and column. The user clicks on the "Monday" column in the first row and enters a number. The user then moves the cursor to the "Tuesday" column of the first row and click the mouse. The Monday's AFTERUPDATE is executed where the SETFOCUS moves to many locations to tally the total hours. My problem is how do I figure out the user clicked on the Tuesday cell? When the code first starts, it appears the focus is still on Monday.

    I hope I have described my problem with enough detail.

    Thanks,

    Ken
     
  4. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    I get it...lemme think on this one.

    Could you post a screen shot of your data entry page for a better idea of the input procedures?
     
  5. ABAPer

    ABAPer Thread Starter

    Joined:
    Sep 14, 2004
    Messages:
    9
    Please see the file attachment for a screen shot.

    Ken
     

    Attached Files:

  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/275065

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice