Recent content by dev_omi

  1. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Fortunately, most people here are super helpful!
  2. D

    Solved Run code AFTER Undo event

    I'll be honest, this is the first time I've ever heard of a "module variable". I used context clues to figure out what it is, and you're right, it works! That was the missing piece (since that is not shown on the SO response). I was just about to post a follow-up response to this thread...
  3. D

    Solved Run code AFTER Undo event

    You can certainly do that, but my aim is not to cancel the undo. Depending on the value of a combo box, I want the form to change visually. In particular, I want one textbox to change colors and several controls to appear/disappear. I wrote a function that carries out these changes, and I call...
  4. D

    Solved Run code AFTER Undo event

    I am, both through testing and through the tooltip thing at the bottom of the screen:
  5. D

    Solved Run code AFTER Undo event

    The Form_Undo event runs before changes to the record are undone. I need code to run after. I found a neat trick here: Access 2007 form: event AFTER undo - Stack Overflow Unfortunately, the code doesn't work for me. The value of the afterUpdate variable is not sustained between the two...
  6. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    I explained in post #13 that merely moving the code to the KeyUp or KeyDown events was not sufficient to make it work (at least not in my Access). I want to test each factor independently and then as pairs to figure out exactly why this is because I'm curious and want to learn to be a better...
  7. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Very much appreciated 😁
  8. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Wow, nice! Yes, that works exactly as intended. I can't really figure out why yours works but mine didn't.. the main things I'm noticing are (1) that you used the KeyDown event instead of KeyPress, (2) that you used KeyCode instead of KeyAscii, and (3) that you didn't call a button click...
  9. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Glancing back over this, your solution is actually very similar to the one I ended up going with. The text box value gets saved because, in your form, Enter tabs to the next control. I'd just like to avoid that if possible (which it is if you refresh the form).
  10. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Excuse me while my eyes roll out of my head. To everyone else: I wasn't able to get the code to work even when putting it on the KeyUp or KeyDown events. Again, it works but only when the string entered in the unbound textbox is saved as the value of that unbound textbox. It's like there is an...
  11. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Then one is welcome to politely mention it, not rudely ask a sarcastic question with a dozen question marks. That's why I tried to head it off in the OP, because it's almost always rude, presumptuous, and lacking literally all of the context. But sure, if your goal is to help users in the...
  12. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Other people, thanks so much for the suggestions. I will be testing them this afternoon
  13. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Relax, man. The Enter key has a variety of functions, even within Access. It can be set to create a new line, to tab to the next control, or to activate the form's default button. Outside of Access, it is *extremely* common to be able to hit Enter to execute a search after entering search terms...
  14. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Okay, I half figured it out! The problem is that the KeyPress event runs before the textbox value is "committed". Hitting enter the first time runs the code, which also "commits" the text box at some point. Then, when I hit enter again, the textbox value is up to date from the prior commitment...
  15. D

    Solved Click button on Enter WITHOUT USING DEFAULT BUTTONS

    Hi all. I've found many threads on this topic, but most of them are forcefully shut down by someone insisting that the OP give up and use default buttons. This is not the right option for me, so please don't suggest it. I have a search box (unbound text box) and, next to it, a search button...
Back
Top Bottom