Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 9th, 2006, 08:55 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
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
Reply With Quote
  #2 (permalink)  
Old January 9th, 2006, 10:52 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #3 (permalink)  
Old January 10th, 2006, 05:16 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
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
Reply With Quote
  #4 (permalink)  
Old January 10th, 2006, 07:13 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
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
Reply With Quote
  #5 (permalink)  
Old January 10th, 2006, 08:13 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
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
Reply With Quote
  #6 (permalink)  
Old January 10th, 2006, 08:16 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
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
Reply With Quote
  #7 (permalink)  
Old January 10th, 2006, 08:54 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #8 (permalink)  
Old January 10th, 2006, 08:58 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
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
Reply With Quote
  #9 (permalink)  
Old January 10th, 2006, 08:44 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:43 PM.


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