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 January 9th, 2006, 08:55 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stop the user tapping

Hi All Again and a happy new year
I have a form with 10 fields is there any way of stopping the user tapping to the first field again after reaching the tenth field
Thanks
Brendan

Brendan Bartley
__________________
Brendan Bartley
 
Old January 9th, 2006, 10:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

The CYCLE property on the form sets whether you want the cursor to move to the first field in the next record (all), move to the first field in the same record (current record), or move to the first field of the same page in that record (current page). It does not have a setting to stop cycling altogether, that is, keep the cursor in the last field and not move.

You could probably put something in the last field's ON KEY PRESS event and see if the key pressed is a tab (ANSI value of 8). If so, you can reset the focus back to the same field.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old January 10th, 2006, 05:16 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Greg
I have tried your suggestion and I cannot get it to work. The problem I have is that user's complete a form with specific details but after the last field is complete and they press tab it generates new details clearing the current details.
Regards
Brendan

Brendan Bartley
 
Old January 10th, 2006, 07:13 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi ya Brendan!

On the last field's after update event, put:
me.field1.setfocus

This will set the focus back to the first field on the form.

Kevin

dartcoach
 
Old January 10th, 2006, 08:13 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Kevin
That's great its working fine
Just one thing is there any way of stopping the user from creating a new form after completing the first one.
Thanks
Brendan

Brendan Bartley
 
Old January 10th, 2006, 08:16 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Brendan,

Do you want your users to only enter 1 record? What do you want to happen when they finish?

Kevin

dartcoach
 
Old January 10th, 2006, 08:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Kevin, the only problem with your suggestion is that you have to update the contents of the textbox for the focusing to happen. What if someone is just tabbing by it without changing it?

Brendan, the clearing effect caused by Access moving on to the next record. You want to set the cycling property to current record only.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old January 10th, 2006, 08:58 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Kevin
yes just one record the user's should click send for it to generate an e-mail automatically
Thanks
Brendan

Brendan Bartley
 
Old January 10th, 2006, 08:44 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Greg,
You are right. The code should be in the onLostFocus event. I agree with the cycling being set to current record also. Brendan, do you need them to click send, or would you rather validate the 10 textboxes, then automatically generate and send the email, notify the user that the message has been sent, then exit?

This could all be done in the onLostFocus event code.

Kevin

dartcoach





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tapping into cache object jazzcatone ASP.NET 3.5 Basics 1 June 8th, 2008 05:10 PM
Stop button won't stop loop JDShaffer Visual Basic 2008 Essentials 3 May 23rd, 2008 03:22 PM
tab stop angelboy C# 2005 1 June 19th, 2007 04:33 AM
Stop watch rohit_ghosh Access VBA 2 May 3rd, 2007 04:14 AM
How to stop user from view js code but still work bekim Javascript How-To 4 January 7th, 2005 09:08 PM





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