+ Reply to Thread
Results 1 to 4 of 4

UserForm to close when user selects 'enter data to spreadsheet'

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    77

    Question UserForm to close when user selects 'enter data to spreadsheet'

    Hi,

    Below is my code.

    The code generates a unique number in 'NameTextBox' each time the customer opens the 'Add Record' Userform and the code won't allow the customer to close the UserForm without entering a date value into 'TextBox12' . This is fine and it works correctly.

    The issue I have is that the customer can hit 'Enter Data to Spreadsheet' multiple times in the UserForm, this enters the same data to the spreadsheet. I only want them to be able to enter this data once. Ideally the UserForm would close once the customer selects the 'Enter data to Spreadsheet' button, however, I don't want the UserForm to close without them entering the date value in 'TextBox12'. The 'Enter Data to Spreadsheet' button is the 'OKButton' Command Button.

    Any help is greatly appreciated

    David


    Please Login or Register  to view this content.
    Last edited by david1987; 01-09-2013 at 07:25 AM.

  2. #2
    Registered User
    Join Date
    01-07-2013
    Location
    Alberta
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: UserForm to close when user selects 'enter data to spreadsheet'

    Hi, my first time replying to a thread, so if doesn't work out sorry. I think that you have a pretty easy fix; just insert userform.close in between some of your code:
    Please Login or Register  to view this content.
    if you want the code to close the userform even if textbox12 value is invalid then just put the userform.close at the end of 'end if'

    Give 'er a go

  3. #3
    Registered User
    Join Date
    08-20-2012
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: UserForm to close when user selects 'enter data to spreadsheet'

    Sorry, that didn't work.

  4. #4
    Registered User
    Join Date
    08-20-2012
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: UserForm to close when user selects 'enter data to spreadsheet'


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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