devxlogo

June 10, 2000

Clone a Font object

When you want to assign a control’s Font to another control, the first obvious way is to assign the Font property directly, as in: Set Text2.Font = Text1.Font but in

Export to a text file with quoted fields

As explained in another item in this Tip Bank, you can use the Recordset’s GetString method to export a Recordset to a comma-delimited or tab-delimited text file. However, if you

Faster string appending with Mid$ command

As you probably know, the “&” operator is rather slow, especially with long strings. When you have to repeatedly append chucks of characters to the same variable, you can speed

Replicate a string of any length

The String$ function can replicate only 1-char strings, so it seems that you need a loop to duplicate strings that contain 2 or more characters. However, this is a one-liner