Load a Combo Box Array With a Compound Recordset in One Call
This code takes an array of combo boxes and fills them using a compound recordset. This allows all combo boxes on a form to be loaded with one sub call.
This code takes an array of combo boxes and fills them using a compound recordset. This allows all combo boxes on a form to be loaded with one sub call.
Use this code to get the shrinking text effect?similar to the opening of Star Wars: ‘ Requires a Label and Timer on the formPrivate Sub Form_Load() With Me .BackColor =
I recently needed a substring replacement function for inserting code into a module, by reading the code from a file. Unfortunately, in my case, commas are interpreted as delimiters, and
If you have to reference a control’s property repeatedly, it’s better to assign the property to a temporary variable, then use that variable. This technique is called property caching. For
Try using a slider control in your UI if you’re tired of combo boxes. Users find this control intuitive to understand and operate. For example, you might use the slider
Sorting ListView columns with numeric data can be a real pain. Nonstring sorting is possible with callbacks using custom comparison functions, but this method’s drawback is that the synchronization between
The latest video drivers can change the display resolution without rebooting. Unfortunately, the Screen object doesn’t always properly return the new display size; it only remembers the display size when
This code allows you to set a form’s controls to a specific value. You can use it, for example, when you want to clear all textboxes in a form or
Replace all MsgBox calls that display only an OK message with the following OkMsg sub. It automatically defaults the icon to vbInformation, and the title to a global constant defined
With the advent of the FAT32 file system, you might want to use VB to determine the type of file system being used for a particular drive. This example is
The value of a loop counter variable is incremented one beyond the set range when the loop is completed. For example, if you use a For i = 0 to
You often need to reattach or refresh links in Microsoft Access. This code refreshes all currently linked tables to sync the attached tables with the server, then remove “dbo_” from
Sometimes it’s useful to close Related Posts How EdTech is Making Higher Education More Accessible WorldwideSurvey: 74% of Businesses Say IoT Will Help Them Meet Key ObjectivesUnlock the Torque 35
The data control allows you to quickly link controls and databases; however, not only is it far from flexible compared with the database-objects coding interface, it doesn’t look great. I
VB6 introduced the Split function, which returns a zero-based, one-dimensional array containing a specified number of substrings. Although this function is useful in itself, you can also use it in
It’s too bad Microsoft didn’t create the Split function until VB6, but here’s a function that duplicates it for VB4 and VB5 users. The only difference is that with VB4
Here’s a useful procedure to position a ComboBox according to a value of the ItemData property or the List property. It’s useful to position a ComboBox with values taken from
This simple piece of code saves a lot of headaches when it comes to altering dates. It allows you to use the plus and minus keys to increment and decrement
Referencing a static local variable in a procedure is two to three times slower than a regular local, dynamic variable. If your procedure demands every last bit of speed possible,
In today’s world, you probably want to let your users browse the Web inside your app. You can add the Microsoft Internet Control to do this; however, the user must
Microsoft has documented a problem with windowless User-Controls that have a transparent Backstyle. Once a form contains such a control, you can’t select it by clicking on it with the
A valid C string consists of an array of zero or more characters plus an additional null character. Thus, the shortest possible string must contain at least one character. Remember
In pre-standard C++, the prototype of main() didn’t have a return value. On some compilers, it was: main() /* no explicit return value; int assumed*/ While others used one of
Applications constantly undergo modifications, bug fixes, and customization. Programmers often remove pieces of obsolete code that use a variable while leaving the declaration of that variable intact. A clever compiler
In legacy code and environments that support C exclusively, using scanf() is still a widespread method of getting input from a user (or a file, when using fscanf()). When using
One of the frequently asked questions I receive is: “I’m learning C at school/college/from a book. Am I wasting my time learning this language? Should I be learning C++ instead?”
Question: What is the easy way for a user to access another user’s calendar (or any other folder in the mailbox)? With Outlook 97/98 you can use the not-so-user-friendly File
Question: When initializing a formset, each of the forms in the set are displayed before the order 1 form gets focus. Is there a way to suppress displaying these other
Question: What is an index and what is a sort? Answer: Here is a table that I will refer to during my answer: RecNo cName nAge—– —– —-1 Rick 342
Question: I write language instruction programs and have been calling mplayer2 to allow students to hear the pronunciation saved in recorded sound files. But mplayer takes forever to load and