I am having a problem with program flow between my forms in a project I’m developing.
My main form is a bunch of buttons that allow the user to select various options. When a button is clicked, I hide the Main form and open the next appropriate form. Normally this works fine, but I have a problem in one spot.
When the user selects the Appointments form, which shows all appointments currently scheduled, the user can select a button to "Schedule a New Appointment". When this button is clicked, I close the Appointment form and open the Schedule form.
On the Schedule form, the user can select a company and an applicant using two combo boxes. Neither of these selections is limited to the list of existing companies or applicants on file. If a new company or new applicant is input, the system adds the company or applicant name to the respective files and the scheduling process goes on as normal. But then I want to be able to collect some contact information for the new company and/or new applicant.
Here is where things don't work the way I want them to. If the company is a new one, I want to open the Company form and hide the Schedule form (Me.Visible False) until the user inputs the information and clicks Exit on the Company form, at which time I want to close the Company form and un-hide the Schedule form to return to it's code processing.
I then check is the applicant is new, and want to do the same process to show the Applicant form until that information is completed and the user clicks that form's Exit button.
But the system does not transfer processing to the Company form, instead it continues running the code in the Schedule form and may show the Applicant screen on top of the Company form. How can I get the program to flow the way I have described?
I have tried to isolate the transfer code to a separate Sub (i.e. – If newcompany then call GetNewCompabyInfo – where that Sub opens the Company form and hides the Schedule form. But that didn’t change anything.
This seems like it should be a simple job to fix, but I'm having a problem with it. Any suggestion would be appreciated.
My main form is a bunch of buttons that allow the user to select various options. When a button is clicked, I hide the Main form and open the next appropriate form. Normally this works fine, but I have a problem in one spot.
When the user selects the Appointments form, which shows all appointments currently scheduled, the user can select a button to "Schedule a New Appointment". When this button is clicked, I close the Appointment form and open the Schedule form.
On the Schedule form, the user can select a company and an applicant using two combo boxes. Neither of these selections is limited to the list of existing companies or applicants on file. If a new company or new applicant is input, the system adds the company or applicant name to the respective files and the scheduling process goes on as normal. But then I want to be able to collect some contact information for the new company and/or new applicant.
Here is where things don't work the way I want them to. If the company is a new one, I want to open the Company form and hide the Schedule form (Me.Visible False) until the user inputs the information and clicks Exit on the Company form, at which time I want to close the Company form and un-hide the Schedule form to return to it's code processing.
I then check is the applicant is new, and want to do the same process to show the Applicant form until that information is completed and the user clicks that form's Exit button.
But the system does not transfer processing to the Company form, instead it continues running the code in the Schedule form and may show the Applicant screen on top of the Company form. How can I get the program to flow the way I have described?
I have tried to isolate the transfer code to a separate Sub (i.e. – If newcompany then call GetNewCompabyInfo – where that Sub opens the Company form and hides the Schedule form. But that didn’t change anything.
This seems like it should be a simple job to fix, but I'm having a problem with it. Any suggestion would be appreciated.