Results 1 to 5 of 5
  1. #1
    Stanley Wang is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    2

    textbox content & event

    I created a textbox unbound and need to fire a macro as each character is entered in the textbox. Is it possible? For example, I have trouble capturing [text0] as subsequent characters are entered, it seems [text0] always gets stuck in its initial content and does not reflect the current as next instance of the event (onKeyPressed? onChange?) macro is executed. Or is [text0] just left undefined until some events like onEnter occurs?

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    The OnChange event should do what you describe, even for an Unbound control.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    As Linq says the change event should work, but note that you have to use the .Text property of the textbox in that event. The .Value property, which is the default, will have the original value. More here:

    http://www.baldyweb.com/ValueText.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Stanley Wang is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    2
    Great information, thank you very much!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Textbox name into event parameter
    By pdanes in forum Forms
    Replies: 64
    Last Post: 10-09-2019, 09:00 AM
  2. pass content of textbox frpm one form to another
    By anthony@aahs.us in forum Forms
    Replies: 5
    Last Post: 05-10-2018, 12:14 PM
  3. Export textbox content as TXT (notepad) file
    By radian89 in forum Access
    Replies: 6
    Last Post: 01-25-2016, 09:39 AM
  4. Replies: 1
    Last Post: 03-11-2015, 03:38 PM
  5. TextBox Content
    By myuser in forum Programming
    Replies: 1
    Last Post: 05-16-2012, 03:07 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums