+ Reply to Thread
Results 1 to 2 of 2

Need Help Calling a Form from a Sub

  1. #1
    Registered User
    Join Date
    01-17-2018
    Location
    Buffalo, New York
    MS-Off Ver
    2016
    Posts
    24

    Need Help Calling a Form from a Sub

    Hello!

    I am using my first form within a VBA project and could use assistance from the experts in this forum! Overall, the project is designed to automatically open a bunch of invoices and copy them over to the main file. In this file, I want to ask the user if an invoice is a specific number. If it is that number, then I want it to automatically code it something different than the excel formulas indicate. So more specifically...

    My goal is to call a form within a sub, enter data into the form, and then use the same data within the sheet and edit fields based on the data entered. The prompt opens and it allows me to enter data but then it never actually changes the information. I have isolated the code within the form and it worked as stand alone code - however, when I try to call it from the form - it simply continues without actually making the edits. There is no error message or anything like that, it just doesn't do what I want it to do. I think this must be a simple error but I could really use some help here - I am banging my head against the wall on this one...

    In order to call form I created from a sub can I simply put:
    Please Login or Register  to view this content.
    Here is the code within the form, perhaps this is where the problem is located.:
    Please Login or Register  to view this content.
    It might be easier to analyze the problems by viewing the workbook and code directly so I have attached the sanitized Invoice Creator workbook as well as four example invoice work books. When the prompt comes up I want to select PFD and enter invoice number "36230352" and "36230354", then select SO and enter invoice number "36230355" and then, finally, select no.

    Any help on this would be greatly appreciated!!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-17-2018
    Location
    Buffalo, New York
    MS-Off Ver
    2016
    Posts
    24

    Re: Need Help Calling a Form from a Sub

    I am fairly certain the problem is related to the 'unload form' code when clicking 'no' on the form. I just ran the sub for 'Yes, PFD' button and it worked on it's own. However, within the context of showing the entire user form, it doesn't work.

+ 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. [SOLVED] Calling a User Form from VBA
    By John Vieren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2018, 05:45 AM
  2. Calling Excel's built in form
    By imogul in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-26-2015, 09:10 PM
  3. Calling data entry form from VBA
    By sardalashvili in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2013, 05:00 AM
  4. Calling a user form initialize sub when entering the form to populate combobox...
    By regupnorth in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-02-2012, 07:24 AM
  5. [SOLVED] Calling and prefilling a form from another form
    By jlt199 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2012, 04:18 PM
  6. [SOLVED] calling function form within sub
    By Dirk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2006, 09:30 AM
  7. Calling the Print Form
    By Derek from Belgium in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2005, 10:06 AM

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