 |
| 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
|
|
|
|

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

January 9th, 2006, 10:52 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
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
|
|

January 10th, 2006, 05:16 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

January 10th, 2006, 07:13 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

January 10th, 2006, 08:13 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

January 10th, 2006, 08:16 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Brendan,
Do you want your users to only enter 1 record? What do you want to happen when they finish?
Kevin
dartcoach
|
|

January 10th, 2006, 08:54 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
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
|
|

January 10th, 2006, 08:58 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Kevin
yes just one record the user's should click send for it to generate an e-mail automatically
Thanks
Brendan
Brendan Bartley
|
|

January 10th, 2006, 08:44 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|
 |