Multi Form Requirement
I have an application which does Invoicing
I normally show my input form by InvForm.Show
I also have variables used globally in a Module for the application
I want to be able to process as many InvoicesI need, (without having to close any other Invoices in Progress - Ie, I want to achieve multiple sale capability)
What do I need to do so that each Invoice maintains its own variables and doesn't conflict or corrupt other Invoices in progress
Do I need to
1) Open the Invoice programs using Load New InvForm (how do I then SHOW the form ?)
2) Do not use Global variables - all variables must be contained within the form itself - Is this correct ?
3) If the Invoice has 3 separate forms to complete the process, then how do I pass variables from one form to the next (I currently use a module with Public variables but this probably won't be able to be used now, right ?)
Appreciate any suggestions
Thanks
[1006 byte] By [
George1111] at [2007-11-20 11:57:01]

# 1 Re: Multi Form Requirement
You could put the form parts into a tab control, or put all the forms into an MDI, but that'd cause problems. If you design it so that orders are only added when they are done, then it wouldn't really matter, unless you needed up to date inventory or something.
Just update everything when then submit an order.
Also, look into using classes rather than global variables.
You might really like VB.Net, as that's all it uses.
# 2 Re: Multi Form Requirement
Have you considered using a Class as your invoice? Obviously the class can be passed back and forth easily enough. Variables within the class are only for that class and you can use class properties to set/retrieve values.
Regarding opening new forms...
Dim myNewInv as New InvForm
myNewInv.Show
And if using a Class to hold invoice stuff, your InvForm can have a Public function where you pass the specific class that will be used with that form.
Just some ideas.