+ Reply to Thread
Results 1 to 35 of 35

Trouble with Code - Adding New Record with Form does not function

  1. #1
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Trouble with Code - Adding New Record with Form does not function

    Hello,

    Instructions... Below is the code..

    The Form lets the User list add,delete etc....

    When you select the Update button - the User is prompted for a Pwd..

    For some reason the code "BROKE"... Not able to add new agents to the list.. Here is the code...

    Please Login or Register  to view this content.
    Any Idea's...

    John
    Last edited by JJFletcher; 09-09-2015 at 07:22 AM.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Trouble with Code - Adding New Record with Form does not function

    It would probably be easier for someone to troubleshoot this if there was a sample workbook with the code and userform in it.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    Am I able to send it to you directly?

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Trouble with Code - Adding New Record with Form does not function

    If there is a way to do that on here, I don't know how to go about doing it. If you send it to me only, then others wouldn't be able to see it. Sometimes it's best to have several people troubleshoot these things because the solution I might provide might not be the best one and someone else may know of a better way.

  5. #5
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    True.. Why are there commercial services and no one is working those?

  6. #6
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    removed attachment
    Last edited by JJFletcher; 09-09-2015 at 07:59 PM.

  7. #7
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Trouble with Code - Adding New Record with Form does not function

    I don't know how the commercial services work, I haven't used them ..........yet.

  8. #8
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    Well they got my hard earned $20 - for sure!

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Trouble with Code - Adding New Record with Form does not function

    Quote Originally Posted by JJFletcher View Post
    For some reason the code "BROKE"... Not able to add new agents to the list.. Here is the code...
    Please explain what "BROKE" means.
    • Does the code run?
    • Does it run but do nothing?
    • Does it produce error messages? If so, what do the messages say?
    • Does it produce unexpected/wrong results? If so, what do you expect, and what actually happens?
    • Does it hang?

    This is long, complex code that is hard to understand out of context. You will get better responses if you attach your file to a post. You can't attach files to a private message, and we discourage using PMs for problem resolution.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  10. #10
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    That is why I paid! It does not enter the new agent to the bottom of the EmployeeData sheet

    If I empty the agents in the Employee Data sheet then add a record - it works but after about 20 records it does not function

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Trouble with Code - Adding New Record with Form does not function

    Please attach your file to a post.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    Quote Originally Posted by JJFletcher View Post
    Well they got my hard earned $20 - for sure!
    I think you overestimate the importance of $20. You're in no danger of being ripped off merely because you're struggling with learning how to use the Commercial Services forum. Post a question there and assign the points, include a link to any duplicate threads here in the free forum and they will be removed for you. No drama at all, albeit a little patience with us and yourself getting used to it may be necessary.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  13. #13
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    Can you please review and advise as to why a new record being added does not function?

    U/P = guest

    Update = "Password"

    VBA = guest
    Last edited by JJFletcher; 09-10-2015 at 09:11 PM.

  14. #14
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    OK, no Commercial Thread, then, you'll continue here in the free forum? The $20 in points you purchased may go to waste if you do not create a Commercial thread and assign points there as a reward for one of our main gurus to attend to it. Just a reminder.

  15. #15
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Trouble with Code - Adding New Record with Form does not function

    The problem is that you have nothing in column A but you are using that column to try and find the next empty row.

    Try using a column that actually has data in it.
    If posting code please use code tags, see here.

  16. #16
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    Norie,

    In the employee column which is Column A has the names of the reps in it - do not understand why you say there is no data?

    Can someone tell me how to create a Post/Thread in the commercial section?

    John
    Last edited by JJFletcher; 09-10-2015 at 06:33 PM.

  17. #17
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Trouble with Code - Adding New Record with Form does not function

    John

    There is nothing in column A on the Ranking sheet in the workbook you uploaded.

    See the attached image.
    Attached Images Attached Images

  18. #18
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    Hi Norie,

    That is the Ranking sheet - the record that is being created is in the EmployeeData sheet

    select Show and enter Password and see

    Please Login or Register  to view this content.
    Last edited by JJFletcher; 09-10-2015 at 07:44 PM.

  19. #19
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Trouble with Code - Adding New Record with Form does not function

    John

    You need to reference things properly, especially when you have hidden sheets.

    This kind of code is just crap.
    Please Login or Register  to view this content.

  20. #20
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    OK Norie.....Why is it Crap?

    And if it is, what is the correct code look like and one that will not break

  21. #21
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    I have deleted the samples - if you want to see them - please ask
    Last edited by JJFletcher; 09-12-2015 at 02:15 AM.

  22. #22
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    Something like this is simply far simpler to read and edit:
    Please Login or Register  to view this content.

  23. #23
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    CaptureError.JPG
    This is the error when running the form
    Last edited by JJFletcher; 09-11-2015 at 07:58 PM.

  24. #24
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    What is the value of that element when the error occurs?

  25. #25
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    I just ran that code exactly as shown after filling in a bunch of random data, no errors encountered.

  26. #26
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    The value for that is the Supervisors names selected from a drop down list - you can see it in the form. Also when I take the last reference to the error - The only data that is placed into the row is the fullname
    Last edited by JJFletcher; 09-12-2015 at 12:09 AM.

  27. #27
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    Video of me using the form: http://screencast.com/t/tcUM56zpU6
    Attached Files Attached Files

  28. #28
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    Please let me know when you are online so I can put the file up

    Here is the exact file I am using - I saved it once the entry was made.. AS you can see - only the full name is featured. Please let me know when you have the file - I want to delete it from the thread...

    The code only placed the full name

    John
    Last edited by JJFletcher; 09-12-2015 at 02:13 AM.

  29. #29
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    See post #27, the code seems fine. I noticed in mine it was putting the data much further down the EmployeeData sheet, so scroll down, perhaps it's doing that to you as well. I cleared all the data from all the cells below the existing data and it stopped doing that.

  30. #30
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    I have actually reworked you samplestats into my project and the only data that is being entered into the last row is the first cell, all others are blank...Any thoughts on this?

  31. #31
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    No, I have no thoughts on a reworked macro or workbook I have never seen.

  32. #32
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    What I meant to say was that I cut and pasted your code in place of the previous... Why only the fullname is being entered is a mystery

    I can see by your response you grow tired of dealing with me... How can I get this posted to Commercial Services so I can have someone else review? The $ is there but I am unable to create the thread because I do not have privileges to do so.

  33. #33
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    Not tired at all, was a polite jab at my lack of mind-reading skills and inability to see into the workings of other workbooks I've never seen.

    Feel free to post it and I'll certainly take a look, not tired at all, I've been here for years and will be for years more. If the file is too large, zip it up.

    I see nothing wrong with your account. I'll ask the Tech Team to have a look, unfortunately that usually takes a bit of time.
    Last edited by JBeaucaire; 09-12-2015 at 12:23 PM.

  34. #34
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Trouble with Code - Adding New Record with Form does not function

    Can I email the file? this seems to work...

    Please Login or Register  to view this content.

  35. #35
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Code - Adding New Record with Form does not function

    Taking out the unneeded "Yes" test is a great. Always adapt the code to only include the tests you actually need. Good stuff.

+ 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. Replies: 3
    Last Post: 08-07-2013, 10:16 AM
  2. [SOLVED] Trouble shooting a user form code
    By JO505 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 03-08-2013, 02:27 PM
  3. [SOLVED] Open a new form, create new record based on current form / record
    By Cyclops in forum Access Tables & Databases
    Replies: 4
    Last Post: 01-28-2013, 06:36 PM
  4. Excel 2007 : trouble adding an additional IF function
    By TEdward00 in forum Excel General
    Replies: 1
    Last Post: 07-07-2011, 05:05 PM
  5. Replies: 2
    Last Post: 12-12-2010, 10:27 PM
  6. Adding code to a form on the fly...
    By Ara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2007, 03:47 PM
  7. [SOLVED] Trouble Adding VBA Code to Module; Bug in Excel/VBE?
    By Mat P:son in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-20-2006, 02:40 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