+ Reply to Thread
Results 1 to 4 of 4

Clear Comboboxes & Textboxes

  1. #1
    MBlake
    Guest

    Clear Comboboxes & Textboxes

    Hi,
    I have a userform containing various VBA controls such as comboboxes,
    listboxes and check boxes. I want to provide the option for a user to clear
    the form. I have tried the below code but get an error message stating
    'Compile error - Sub or Function not defined'

    Please can anyone tell me where I am going wrong with this?

    Command Button Code -

    Private Sub cmdbuttonClear_Click()
    Call frmDataEntry_Initialize
    End Sub

    Thanks for any help,
    Mickey



  2. #2
    Alan
    Guest

    Re: Clear Comboboxes & Textboxes

    Try using the Command Button with the code like

    Private Sub CommandButton1_Click()
    ComboBox1 = ""
    TextBox1 = ""
    End Sub

    etc
    Regards,

    "MBlake" <mickeyblake@omitthisbtopenworld.com> wrote in message
    news:eImSAlyTFHA.616@TK2MSFTNGP12.phx.gbl...
    > Hi,
    > I have a userform containing various VBA controls such as comboboxes,
    > listboxes and check boxes. I want to provide the option for a user to
    > clear the form. I have tried the below code but get an error message
    > stating 'Compile error - Sub or Function not defined'
    >
    > Please can anyone tell me where I am going wrong with this?
    >
    > Command Button Code -
    >
    > Private Sub cmdbuttonClear_Click()
    > Call frmDataEntry_Initialize
    > End Sub
    >
    > Thanks for any help,
    > Mickey
    >




  3. #3
    Chip Pearson
    Guest

    Re: Clear Comboboxes & Textboxes

    You probably want

    Call Userform_Initialize

    rather than

    Call frmDataEntry_Initialize


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "MBlake" <mickeyblake@omitthisbtopenworld.com> wrote in message
    news:eImSAlyTFHA.616@TK2MSFTNGP12.phx.gbl...
    > Hi,
    > I have a userform containing various VBA controls such as
    > comboboxes, listboxes and check boxes. I want to provide the
    > option for a user to clear the form. I have tried the below
    > code but get an error message stating 'Compile error - Sub or
    > Function not defined'
    >
    > Please can anyone tell me where I am going wrong with this?
    >
    > Command Button Code -
    >
    > Private Sub cmdbuttonClear_Click()
    > Call frmDataEntry_Initialize
    > End Sub
    >
    > Thanks for any help,
    > Mickey
    >




  4. #4
    MBlake
    Guest

    Re: Clear Comboboxes & Textboxes

    Cheers Guys,
    Some days I feel likeI am getting there and then other days I feel miles
    away. It is all good fun though :-)

    Mickey



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1