Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 December 27th, 2004, 07:24 PM
Authorized User
 
Join Date: Aug 2004
Location: Harrisburg, PA, USA.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Record Selectors

I have a form used to update my printers database. I use the record selectors to update the database, as most people do. When I click the add new record button(>*) I want it to put the focus on the first text box. When I click the >* button it stays in the box where the cursor was before I clicked the >* button. Is this going to take VBA code?

 
Old December 28th, 2004, 03:04 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

You can use VBA code to set focus to the text control. It´s quite easy. Just put the following code to Forms´s OnCurrent event:

Private Sub Form_Current()
    If Me.NewRecord = True Then
        txtControl.SetFocus
    End If
End Sub

 
Old December 28th, 2004, 09:56 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You can also use the Properties>Tab Order dialog box. This should set the focus on the item at the top of the list.

mmcdonal




Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS3 Selectors m_norouzi CSS Cascading Style Sheets 1 November 4th, 2007 10:58 AM
Delete a record row, not just the record. Coby Access VBA 1 April 30th, 2007 06:29 AM
how to add new record as first record in dataset hunzian78@yahoo.com ASP.NET 1.0 and 1.1 Professional 4 April 21st, 2006 05:23 AM
Record locking - user needs the next queued record cbtoolkit SQL Server 2000 0 December 6th, 2004 08:29 AM
Sub record not associating with Main record Ron V Access 1 August 31st, 2004 09:21 AM





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