Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2009, 06:36 AM
Authorized User
 
Join Date: Nov 2008
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to MonkeyMan666
Default Set Focus of a form

Hiya,

I am having a problem with the SetFocus function on a form using Access 2003 in a .adp file.

I have a list of fields, some of which require the user to scroll down the screen to see them. When one of these is updated a stored procedure is fired to update the cumulative totals and the form is requeried. In order for the user to go to the next relevant field I set the focus to that control but when the form is refreshed it scrolls back to the top.

The focus is being set correctly but it is the window scrolling to the top which is the issue. Is there anyway to scroll the window back down so the user can see the control that has the focus.

The code for this is:

Code:
'Requery the form
Forms!frmDetailed.Requery
    
'Set the focus to ActualTotal
Me.ActualTotal.SetFocus
Thanks in advance
 
Old March 5th, 2009, 09:32 AM
Authorized User
 
Join Date: Nov 2008
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to MonkeyMan666
Default

I fixed it, the problem was I was requerying the main form not the subform, changed this and it works fine.

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
set Focus to web control in Web form vivekshah C# 1 June 17th, 2006 03:25 AM
Set Focus on a Sub Form Brendan Bartley Access 5 September 9th, 2005 10:49 AM
set focus akibaMaila VB.NET 2002/2003 Basics 1 July 12th, 2005 05:56 PM
how to set focus waley .NET Web Services 1 May 25th, 2004 02:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.