Results 1 to 8 of 8
  1. #1
    xredvette6 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    7

    Clearing text field on a form after feeding data to an access query

    I am stumped by something I would not think should be so difficult. I am using a small form with one text box which is populated by a user to set the value for a data query in Access (the query is based on [forms]![IDForm]![CustRefType] - my lookup form is [IDForm] and the criteria is [CustRefType]. The query returns a record in another form which the user uses to update the record. I need to be able to get the original text box value cleared so when the user closes the record form he/she has a clear text box to enter the next record ID to be queried on.



    This is going to be a web database so I have to get this done via a macro. I cannot locate the code to get this done - either based on the click event of the search box form or the save/close event on the record update form.

    Any help would be appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    It would either be SetValue or SetProperty in a macro.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Just curious..... the control you want to clear is unbound, isn't it???

  4. #4
    xredvette6 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    7
    Quote Originally Posted by pbaldy View Post
    It would either be SetValue or SetProperty in a macro.
    Neither of those options are available in the macro string. I would normally use SetField but that is not an option either.

  5. #5
    xredvette6 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    7
    To be honest I'm not sure. I created a one field [CustRefType] form with a cmd [Search] button. I have a query that points to the CustRefType on the form as the criteria for pulling up the corresponding record. I created a form to show the results of the query. The Search button on the first form opens the query form and does show the correct record information. My issue is when I save and close the main form the original information typed into the CustRefType field on the search form is still present. I would like to have that field blank and awaiting the next entry.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Make sure you've clicked on Show All Actions on the ribbon.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    xredvette6 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    7
    It is. For some reason the macro will not give me the options normally associated with setting a field value.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Can you post the db here?
    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. Replies: 4
    Last Post: 01-04-2013, 04:03 PM
  2. Replies: 12
    Last Post: 06-04-2012, 10:55 AM
  3. Replies: 3
    Last Post: 04-20-2012, 04:33 PM
  4. Replies: 1
    Last Post: 05-17-2010, 12:21 PM
  5. Feeding fields from one form to another
    By dahand in forum Forms
    Replies: 0
    Last Post: 02-15-2008, 01:48 PM

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