Results 1 to 4 of 4
  1. #1
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125

    Clear a Field OnClick


    I was wondering if there was a way to clear the data in a field when clicking it. So far I've just found questions about clearing all fields in the form but that's not what I'm after.

    I've created a search box that searches the records by Job # but when you click to enter the Job # that you want to search, the previously searched Job # is still there. This isn't a big problem as you can just delete it, but I'm trying to make this work as easily and efficiently as possible, so ideally I'd like just a click and go box.

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    in your On_Click,
    Me.objectName = ""
    or Me.objectName = vbNullString

  3. #3
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125
    awesome, the first one didn't work for me but the vbNullString does exactly what I wanted, thanks a bunch.

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    anytime. Go ahead and mark the thread solved so others can make use of it. Thanks!

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

Similar Threads

  1. OLEunbound onclick event
    By thangasiva in forum Access
    Replies: 1
    Last Post: 06-27-2010, 01:49 PM
  2. Set onclick via VBA
    By Gerry in forum Programming
    Replies: 6
    Last Post: 04-19-2010, 09:23 AM
  3. OnClick event
    By HotTomales in forum Forms
    Replies: 1
    Last Post: 12-24-2009, 08:10 PM
  4. clear field values
    By surrendertoo in forum Queries
    Replies: 0
    Last Post: 02-23-2008, 10:57 PM
  5. Search and Clear button
    By polk383 in forum Programming
    Replies: 1
    Last Post: 08-30-2006, 08:51 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