+ Reply to Thread
Results 1 to 12 of 12

New Entry From User Form Not Adding

  1. #1
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    New Entry From User Form Not Adding

    Hello all,

    I have an entry user form called by clicking 'Manual Entry' on the 'Entries'! sheet. The form pops up but when clicking 'Add New Entry' no entries are added to the next row available. It was working at one time but not sure why it isn't now.

    If someone has a chance to check on this I would appreciate it.

    The only thing I have done is trying to share it on OneDrive if that matters.

    Thank you,
    Joe

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: New Entry From User Form Not Adding

    Hi,

    It does add a new entry beneath the last row in your table (row 50).
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: New Entry From User Form Not Adding

    The line of code to ascertain the last row is finding the last row in the table rather than the last populated row in column A.
    Change that to look from A2 down rather than A1048576 up and it should work.
    From
    Please Login or Register  to view this content.
    To
    Please Login or Register  to view this content.
    BSB

  4. #4
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    Re: New Entry From User Form Not Adding

    I didn't see that but it should be entering in the next blank row. Any ideas?

  5. #5
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    Re: New Entry From User Form Not Adding

    Changing the code worked! Thank you Mr. Badly

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: New Entry From User Form Not Adding

    It depends on why you have empty rows in your table- that somewhat defeats the purpose of using a table.

  7. #7
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    Re: New Entry From User Form Not Adding

    Are there any other issues with the codes that you can see?

  8. #8
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    Re: New Entry From User Form Not Adding

    Sorry that was off topic to ask. I will mark this as solved.

    Thank you very much for your help,
    Joe

  9. #9
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: New Entry From User Form Not Adding

    With the code for the userform, there appear to be no issues as it's working, but it could be more efficient / easier to read.
    Personal preference comes in to it here as we all have our own coding styles.

    For example, all those lines of code where you have 'lngLastRow + 1'. If you add one to the line where you set the last row then you haven't got to add one each time you call lngLastRow.
    Also you don't need to keep using .Value and .Text . I tend to miss these out unless I'm dealing with numbers in which case I'd use .Value .

    In addition, and this really is personal preference, you don't need to use all that code to clear the form ready for a new entry. You can simply unload and reload the form to do the same.

    Below is a slight rewrite of your code. Does the same thing, just a little easier to read which is important when it comes to debugging extensive code.

    The other thing I would do is ensure you rename all the controls that you will be manipulating.
    'ComboBox1' is not as helpful as 'CB_VariableExpense'
    BSB

    Please Login or Register  to view this content.
    Last edited by BadlySpelledBuoy; 03-28-2017 at 09:41 AM.

  10. #10
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    Re: New Entry From User Form Not Adding

    I tried that code. I put a variable expense example and it entered fine. The Fixed Expense and Income cells show validation errors. It seems that they are calling to be required.

    Only one of the three options will be selected. Actually on occasion none of the three may be an entry just to record a non affecting budget item.

    Thank you,

    I have a meeting and will be back in an hour,
    Joe
    Last edited by LewisJ; 03-28-2017 at 09:45 AM.

  11. #11
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: New Entry From User Form Not Adding

    In that case you will need the .Text on the end of those three lines.
    Not sure why it does that. I have similar workbooks that don't show the error flag (although that could be because I've turned it off! Cannot recall).

    BSB
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    Re: New Entry From User Form Not Adding

    Sorry for the delay the meeting extended. The new code is perfect thank you.

+ 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. User form Data Entry Help VBA
    By yates1_99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2015, 01:14 AM
  2. User Form Data Entry Adding a TimeStamp
    By caltman242 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2015, 09:15 AM
  3. User Form Data Entry
    By caltman242 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2015, 04:36 AM
  4. user form entry
    By niiflo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2013, 05:22 PM
  5. Edit the entry in user form
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2010, 04:40 AM
  6. Require Entry in User Form
    By Leah in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-19-2009, 08:10 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