More Forms or More VBA

Gazza1709

New member
Local time
Today, 18:09
Joined
Sep 9, 2018
Messages
7
Hi all,

I have a form that I use for all my sales side orders (Quotes, Orders, Invoices etc), I use vba code to setup the form when it opens and also set the subform to use depending on the type of order.


My question is - Is it better to create different forms for each order or use vba code as I am to setup the form?
 
Not really enough to go on. If they all use the require essentially the same data, then use just 1 form and then VBA to slightly customize it for each.
 
Unfortunately, there is no answer to that question without a lot more data AND without us knowing if YOU have a preferred way to work. There are cases where either answer is right and the other is wrong. And only YOU know what you really want to do.

plog's comment, however, is quite correct. The closer the special sub-forms are to each other, the easier it will be to just use the same form and maybe tweak it a bit. So you would use VBA to tweak the form. On the other side of that coin, if you have a single sub-form, you would be using VBA to redefine the form that gets plunked down into the sub-form slot and would have to reassert parent/child form linkages. So I don't see you avoiding SOME type of VBA no matter what you do.
 
Hi all,

Thanks for the answers.

This wasn`t really a specific question as such, I was just wondering what the experts prefer to use. the orders example above was just an example of a business process.

From the answers I am guessing that if that more code is the way to go if it is all part of one business process.

Is there any speed and performance gain in doing it either way?
 
Having the multiple forms ready to load with no other customization required is the fastest way. Having a lot of customization code that has to be executed during Form_Load events is probably not so fast, particularly if domain aggregates like DCount or DLookup get used.
 
so the form will load blank

Easier to have form's recordsource as
Code:
select * from YourTable where false

Alternatively, set the form's filter to
Code:
False=true
 

Users who are viewing this thread

Back
Top Bottom