StlinkCriteria, stdocname

mcclunyboy

Registered User.
Local time
Today, 13:42
Joined
Sep 8, 2009
Messages
292
hi,

Why do people use these?

I normally (not being an expert) would just type:

docmd.openform "form name" , , ,"criteria"

Is it easier in larger projects to define these 2 values in variables ? or is there other benefits I havent seen.
 
While it is perfectly acceptable to just type in your code as you have described, there are numerious reasons for adopting the use of variables when supplying the name of objects.

One very common reason, for me at least, is when I have multiple forms, one of which would need to be opened based of multiple options being seleclted or not. In this situation I can use a case statement (one or more) and simpley assign the form name to the appropriate variable and then only have one statement following the case statement that actually does the work.

There are other situations where it is good, so I think the concept is to teach everyone to use these variables so that when they run into these situations where they are really useful, the developer is already familiar with using them.
 

Users who are viewing this thread

Back
Top Bottom