Subject: Stop the user tapping
Posted By: Brendan Bartley Post Date: 1/9/2006 7:55:18 AM
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
Reply By: SerranoG Reply Date: 1/9/2006 9:52:59 AM
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 By: Brendan Bartley Reply Date: 1/10/2006 4:16:59 AM
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 By: dartcoach Reply Date: 1/10/2006 6:13:28 AM
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 By: Brendan Bartley Reply Date: 1/10/2006 7:13:49 AM
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 By: dartcoach Reply Date: 1/10/2006 7:16:28 AM
Brendan,

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

Kevin

dartcoach
Reply By: SerranoG Reply Date: 1/10/2006 7:54:14 AM
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 By: Brendan Bartley Reply Date: 1/10/2006 7:58:55 AM
Kevin
yes just one record the user's should click send for it to generate an e-mail automatically
Thanks
Brendan

Brendan Bartley
Reply By: dartcoach Reply Date: 1/10/2006 7:44:47 PM
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

Go to topic 38563

Return to index page 398
Return to index page 397
Return to index page 396
Return to index page 395
Return to index page 394
Return to index page 393
Return to index page 392
Return to index page 391
Return to index page 390
Return to index page 389