Simplifying the Condition-Part of an If statement
When you write an If statement such as: If Category = “CM” or Category = “M2” or Category = “P1” or Category = “ZZ” thenProcessEmployeeEndif it can be simplified by:
When you write an If statement such as: If Category = “CM” or Category = “M2” or Category = “P1” or Category = “ZZ” thenProcessEmployeeEndif it can be simplified by:
If you have to assign True or False to a variable after testinga certain condition, then the If statement may be done away withaltogether. For example, if you have something
Most collections are zero-based. The COUNT property returns thenumber of members of a collection, as opposed to the highest membernumber. So when we see code that loops through all the
It’s a good idea to set your form variables to Nothing to recoverall memory that was allocated for the form module. Executing SetForm1 = Nothing for a loaded form, however,
This sample file from Microsoft allows a more automated Windows95 Registry Addition. You can create a similar file in Notepador your favorite text editor, replacing the appropriate entriesin place of
If you set a form properties caption to “” and controlbox to False, then a form with borderstyle 3 (fixed dialog) willdisplay without its title. Unlike borderstyle zero (none), itkeeps
In VB3, if you wanted to display a list box adjacent to anothercontrol such as a PictureBox on a sizable form, you were confrontedwith the problem that a list box’s
To secure a Jet database, you must purchase Access 2 for VB3/VB3-16or Access 95 for VB4-32 and follow these steps: Use the Access Workgroup Administrator to create a new workgroupwith
The regular grid that comes with Visual Basic cannot be editeddirectly. However, this problem can be easily circumvented withone line of code: Private Sub Grid1_KeyPress(KeyAscii As _ Integer)Grid1.Text = Grid1.Text