Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2020
    Posts
    19

    Combobox needs to be blank when clicking add new record button


    Hi there,

    I have an unbound combobox. When user selects a customer, then they can complete the form with the new information. When clicing on the add new record button, I want the combobox to be blank. This works fine when you first open the form. What code do I need please when the button add new record is clicked? There is already a access macro on the onclick event.

    Thank you kindly,
    Tess

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    You use macro or VBA?

    Set the combobox to Null.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Jun 2020
    Posts
    19
    Hi June,

    I'm mostly using vba. However, I have some macros from the buttons I placed on the forms that access generates. I am attaching the code from the click event from the button that allows a new record to be added. I appreciate your help. I have been researching it but can't seem to solve this.
    Click image for larger version. 

Name:	click code.JPG 
Views:	10 
Size:	29.7 KB 
ID:	42305

    Thank you kindly,
    Tess

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    For a macro, look at the SetValue action. Will have to click ShowAllActions to see it.

    Recommend converting macros to VBA.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Join Date
    Jun 2020
    Posts
    19
    Which event would i put the code in June?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    In the button click I suppose. Where do you want this action to occur?

    Did you try Null in the Value argument of the SetProperty action? If this does not work then try SetValue.

    I don't use macros.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. only save record when clicking on a button
    By mar7632 in forum Access
    Replies: 13
    Last Post: 03-27-2019, 06:51 AM
  2. Update ComboBox when clicking next record
    By MrDummy in forum Forms
    Replies: 6
    Last Post: 12-07-2015, 02:58 PM
  3. Replies: 2
    Last Post: 09-15-2015, 03:08 AM
  4. Replies: 9
    Last Post: 08-20-2013, 09:59 AM
  5. Replies: 1
    Last Post: 09-10-2012, 11:21 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