devxlogo

Tip Bank

Don’t Remove Controls Using Tools-References

Use the Tools-Custom Controls dialog instead of Tools-References toremove controls. The project file will show references to all custom controlsin the project’s toolbox, even if they are not used by

Center Your Forms

Add a method in VB 4.0 to center your forms against the screen or aparent form. Create a new project with two forms. Add this code to Form2: Public Sub

New Declarations Possibilities For VB4

Add Optional parameters to your procedure calls. Both Functions and subs can now use the Optional keyword in the declaration to indicate that the following parameter is optional: Function mfbCheckDBStatus(Optional

Align All Your Controls On A Form

To line up controls on a form in VB4, select all the controls you want to line up. Press F4 to bring up the properties window. Then double-click on the

Passing A Control Array

Working with control arrays in VB3 was frustrating, but with VB4 youcan pass a control array as an argument to a function. Simply specify theparameter type as Variant: Private Sub

Add Properties To Data Access Objects

How many times have you wished field objects had a “RequiredIfCondition1″or other user-defined property? You can add one easily: Set NewProperty = Field1.CreateProperty(“FieldNote”)NewProperty.Type = dbTextField1.Properties.Append NewProperty

Hard-Lock a Table

In many applications, I want to make absolutely sure that the data in a Jet table doesn’t get modified under any circumstances. I hard-lock the table in addition to using