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 after Undo
Hello,
I have some code in the AfterUpdate event of textbox that uses DLookup to check for a value in a table. If the value is found, I provide the user the option to ignore the duplicate or undo the entry of the textbox. I use a simple me.Undo that wipes the data from the textbox, but I cannot seem to set the focus back to the same text box (so they can start over). Am I doing something wrong? Should I not be using me.undo? alex |
#2
|
|||
|
|||
Set Focus after Undo
If the focus should not leave the box, use the BeforeUpdate event of the
control instead of AfterUpdate. The focus won't leave if you include the line: Cancel = True BeforeUpdate is less flexible for altering the value. Perhaps you could undo the control, or just let the user change it -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "alex" wrote in message ... Hello, I have some code in the AfterUpdate event of textbox that uses DLookup to check for a value in a table. If the value is found, I provide the user the option to ignore the duplicate or undo the entry of the textbox. I use a simple me.Undo that wipes the data from the textbox, but I cannot seem to set the focus back to the same text box (so they can start over). Am I doing something wrong? Should I not be using me.undo? alex |
#3
|
|||
|
|||
Set Focus after Undo
On May 1, 10:56*pm, "Allen Browne" wrote:
If the focus should not leave the box, use the BeforeUpdate event of the control instead of AfterUpdate. The focus won't leave if you include the line: * * Cancel = True BeforeUpdate is less flexible for altering the value. Perhaps you could undo the control, or just let the user change it -- Allen Browne - Microsoft MVP. *Perth, Western Australia Tips for Access users -http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "alex" wrote in message ... Hello, I have some code in the AfterUpdate event of textbox that uses DLookup to check for a value in a table. If the value is found, I provide the user the option to ignore the duplicate or undo the entry of the textbox. I use a simple me.Undo that wipes the data from the textbox, but I cannot seem to set the focus back to the same text box (so they can start over). Am I doing something wrong? *Should I not be using me.undo? alex- Hide quoted text - - Show quoted text - That worked well Allen, thanks for the help. alex |
Thread Tools | |
Display Modes | |
|
|