Prevent Errors When Using GetSetting
Using Visual Basic’s GetSetting function might cause an error, particularly in certain situations when using itunder 16-bit operating systems with INI files. If there’s no specific entry in the INI
Using Visual Basic’s GetSetting function might cause an error, particularly in certain situations when using itunder 16-bit operating systems with INI files. If there’s no specific entry in the INI
You’re probably familiar with the Mid function, which returnsa substring of a specified number of characters from its stringargument. But are you aware that Mid can also be used to
To move a control or form to a new location, you can set the Leftand Top properties to new values: frmCustomer.Left = frmCustomer.Left + 100 frmCustomer.Top = frmCustomer.Top + 50
Use Debug.Print “Entering event …” without breakpointsto trace events if they seem to act funny. Don’t use break points withMsgBoxes–they can alter the event sequence.
Eliminate “leading-zeros” in a text string in this interestingway: instring$ = “00030” ‘ set the string with some leading-zeros’ now to get rid of them….instring$ = CStr(Cint(instring$))’ now instring$ should
Use this as a fast way to paint the background of any form witha really cool “fading” color (lighter at top to darkerat bottom). To specify base color, pass True/False
This syntax is much faster than using an If.Then.Else construct to detectnull or zero-length fields, and it will ensure that an error will not occur.For strings: Dim sVar As String.sVar
Use the SendKeys function to exploit the delete functionalityof many grid and spreadsheet controls that have a delete functionality.Use this functionality without writing code to delete each rowif your form
I use this procedure to center my forms. With frmParent, the lastloaded form is centered against the parent form. Otherwise, it’scentered against the screen. I always center forms in the