Access clear a text box

Solved
yoell Posted messages 19 Status Member -  
 jason -
Hello,

On Access, I'm looking to create the following event: "when I click a button in a form, a text box clears elsewhere"
This text box having been filled in beforehand.

Is this possible on Access 2003?
Configuration: Windows XP Internet Explorer 7.0

2 answers

  1. Lazarey Posted messages 3255 Registration date   Status Member Last intervention   745
     
    Hi, yes it's definitely possible.

    Switch to creation mode in your form, then right-click on the button and select properties.
    Then, in the events tab, on the "on click" event choose "code generator."

    For the next steps, we will assume that the textbox to be cleared is called "texte0".
    You need to put this in the procedure, where the cursor is located:

    Private Sub Commande0_Click() Me.Texte0 = "" End sub 


    The codes "Private Sub Commande0_Click()" and "End Sub" are usually already written.
    1
    1. yoell Posted messages 19 Status Member
       
      Great Lazarey,

      It works!

      Indeed, it's super easy... I was stressing out way more...

      Thanks a lot anyway for the mini code (I don't know VB very well).
      0
  2. Lazarey Posted messages 3255 Registration date   Status Member Last intervention   745
     
    You're welcome, indeed, we can do a lot of things with VBA, and sometimes it's actually quite simple.
    Anyway, if you have any other questions, feel free to ask.
    0
    1. jason
       
      Hello,
      Under access, I would like to delete several text areas.
      My criterion for choosing the text area to delete is the last text area where I made a modification or where I clicked before pressing the delete button.

      Thank you in advance for your response.
      0