If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Set Focus
I have an event procedure (Me.fieldname.setfocus) "After Update" in a field
so that when the user changes the contents, the cursor will remain in the field. Unfortunately, this does not work, as when the user presses the enter key, the cursor moves to the next field in the Tab order. Is there any way one can get the cursor to remain in this field, until another action is performed? Thanks for any help |
#2
|
|||
|
|||
Set Focus
One way:
Place an unbound Text Box on your form adjacent to the control you want to retain focus. set its width property to zero making it not visible to the user. (Do not set its visible property to No because it must be able to accept focus) You will then see your new text box in the Tab Order. Move the text box tab order to behind the control to retain focus so that it becomes the next control to accept focus. In the text box on got focus event, set focus back to the previous control. Me.PreviousControl.SetFocus Now whenever the user presses enter, the same control will appear to retain focus until the user clicks out of the control. I hope I have explained this well and it helps you??? Kindest Regards Mike B -- Advice to Posters. Check your post for replies or request for more information. Consider providing some feed back to the response you have recieved. Kindest Regards Mike B "Roger Bell" wrote: I have an event procedure (Me.fieldname.setfocus) "After Update" in a field so that when the user changes the contents, the cursor will remain in the field. Unfortunately, this does not work, as when the user presses the enter key, the cursor moves to the next field in the Tab order. Is there any way one can get the cursor to remain in this field, until another action is performed? Thanks for any help |
#3
|
|||
|
|||
Set Focus
Actually all you have to do is Setfocus to any other ***existing control***
then set it back to the control in question; you don't need to create a special textbox for this. To have the cursor "remain" in the textbox if the value is changed (a strange requirement, but we each have our own needs!): Private Sub FirstTextbox_AfterUpdate() If Me.FirstTextbox Me.FirstTextbox.OldValue Then AnyOtherTextBox.SetFocus FirstTextbox.SetFocus End If End Sub -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200901/1 |
Thread Tools | |
Display Modes | |
|
|