+ Reply to Thread
Results 1 to 7 of 7

Submit Button/Data Entry Form

  1. #1
    Registered User
    Join Date
    10-27-2014
    Location
    Louisiana
    MS-Off Ver
    2013
    Posts
    15

    Submit Button/Data Entry Form

    Hi,

    I am looking for any tips on how to get the submit button I have on the attached worksheet to work. I want to put info in the form I created and upon submit, populate the fields on the second tab and clear the sheet for a new entry. Any help would be appreciated. Thanks, in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Submit Button/Data Entry Form

    Hi Kheiron,

    See the attached file which implements what you want for a few fields. It should help you get started. I've also added some other features:
    a. Clear 'ENTRY SHEET' CommandButton.
    b. 'Double Click' on cell 'A1' in 'ENTRY SHEET' to go to cell 'A1' in 'CAPTURED DATA'.
    c. 'Double Click' on cell 'A1' in 'CAPTURED DATA' to go to cell 'A1' in 'ENTRY SHEET'.
    d. 'Double Click' any place in 'CAPTURED DATA' on a row that contains data, and that entry will be placed in 'ENTRY SHEET' (if 'ENTRY SHEET' Employee Name field is BLANK).

    Sheet 'ENTRY SHEET' module code:
    Please Login or Register  to view this content.

    Sheet 'CAPTURED DATA' module code:
    Please Login or Register  to view this content.

    Ordinary Code Module code (e.g. Module1):
    Please Login or Register  to view this content.
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    Lewis
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-27-2014
    Location
    Louisiana
    MS-Off Ver
    2013
    Posts
    15

    Re: Submit Button/Data Entry Form

    Thank you for the help and I am starting to get this, I think. I have run into an issue at the moment, however. I made sure I followed the syntax of the previous lines and started adding the rest of the columns. But now it is saying, "Variable Not Defined" and highlighting the Sub ClearEntrySheet () line. I know you indicated to "Require Variable Declaration" in your post. The problem with that is, I am on Excel 2016 on a Mac. And much has changed from 2011. Tools>Options isn't even available. I don't think this program was ready for prime time when they released it. I need to figure out a way around it I guess, or try to get my hands on a different version.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Submit Button/Data Entry Form

    Hang in there.

    The best thing to do to diagnose the problem is for you to upload a sample workbook that exhibits the problem. Indicate exactly what keys (and or mouse clicks) are needed to make the problem appear.

    That way we can see if it is a computer specific problem or a general problem.

  5. #5
    Registered User
    Join Date
    10-27-2014
    Location
    Louisiana
    MS-Off Ver
    2013
    Posts
    15

    Re: Submit Button/Data Entry Form

    Nevermind. I figured out my error. Thank you for the response though.
    Attached Files Attached Files
    Last edited by Kheiron; 08-03-2015 at 03:51 PM.

  6. #6
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Submit Button/Data Entry Form

    I'm glad you figured it out by yourself.

    a. 'Option Explicit' is very important, but can only be used once at the top of each module.
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    b. You also had several missing cell constants.

    ---------------------------
    Here are a few debugger secrets that may help you:
    a. Press 'F8' to single step (goes into subroutines and functions).
    b. Press SHIFT 'F8' to single step OVER subroutines and functions.
    c. Press CTRL 'F8' to stop at the line where the cursor is.
    d. 'Left Click' the margin to the left of a line to set (or clear) a BREAKPOINT.
    e. Press CTRL 'G' to open the IMMEDIATE WINDOW. 'debug.print' statements send their
    output to the IMMEDIATE WINDOW.
    f. Select View > Locals to see all variables while debugging.
    g. To automatically set a BREAKPOINT at a certain location put in the line:
    'Debug.Assert False'
    h. To conditionally set a BREAKPOINT at a certain location put in lines similar to:
    if i >= 20 and xTV20 > 99.56 then
    Debug.Assert False
    endif
    i. A variable value will be displayed by putting the cursor over the variable name.

    Lewis

  7. #7
    Registered User
    Join Date
    10-27-2014
    Location
    Louisiana
    MS-Off Ver
    2013
    Posts
    15

    Re: Submit Button/Data Entry Form

    Appreciate the help. I got everything working and doing as I intended.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Submit Form w/Button & Data Management Sheet
    By lampe2007 in forum Excel General
    Replies: 1
    Last Post: 01-30-2015, 06:28 PM
  2. Replies: 1
    Last Post: 02-05-2012, 09:31 PM
  3. Form with submit button
    By Hooter in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  4. Form with submit button
    By Hooter in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Form with submit button
    By Hooter in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. Form with submit button
    By Hooter in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  7. [SOLVED] Form with submit button
    By Hooter in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-08-2005, 03:05 PM

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