OldBorderStyle Property
You can use this property to set or returns the unedited value of the BorderStyle property for a form or control. This property is useful if you need to revert to an unedited or preferred border style. Read/write Byte.
expression.OldBorderStyle
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
For forms, the BorderStyle property uses the following settings.
Setting | Visual Basic | Description |
---|---|---|
None | 0 | The form has no border or related border elements. The form isn't resizable. |
Thin | 1 | The form has a thin border and can include any of the border elements. The form isn't resizable (the Size command on the Control menu isn't available). You often use this setting for pop-up forms. (If you want a form to remain on top of all Microsoft Access windows, you must also set its PopUp property to Yes.) |
Sizable | 2 | (Default) The form has the default border for Microsoft Access forms, can include any of the border elements, and can be resized. You often use this setting for normal Microsoft Access forms. |
Dialog | 3 | The form has a thick (double) border and can include only a title bar, a Close button, and a Control menu. The form can't be maximized, minimized, or resized (the Maximize, Minimize, and Size commands aren't available on the Control menu). You often use this setting for custom dialog boxes. (If you want a form to be modal, however, you must also set its Modal property to Yes. If you want it to be a modal pop-up form, which dialog boxes typically are, you must set both its PopUp and Modal properties to Yes.) |
For controls, the OldBorderStyle property uses the following settings.
Setting | Visual Basic | Description |
---|---|---|
Transparent | 0 | (Default only for label, chart, and subreport) Transparent |
Solid | 1 | (Default) Solid line |
Dashes | 2 | Dashed line |
Short dashes | 3 | Dashed line with short dashes |
Dots | 4 | Dotted line |
Sparse dots | 5 | Dotted line with dots spaced far apart |
Dash dot | 6 | Line with a dash-dot combination |
Dash dot dot | 7 | Line with a dash-dot-dot combination |
Double solid | 8 | Double solid lines |
- If the OldBorderStyle property is set to None or
Dialog, the form doesn't have Maximize or Minimize buttons,
regardless of its MinMaxButtons property setting.
- If the OldBorderStyle property is set to None, the form
doesn't have a Control menu, regardless of its ControlBox
property setting.
- The OldBorderStyle property setting doesn't affect the display of the scroll bars, navigation buttons, the record number box, or record selectors.
Example
The following example demonstrates the effect of changing a control's BorderStyle property, while leaving the OldBorderStyle unaffected. The example concludes with setting the BorderStyle property to its original unedited value.
With Forms("Order Entry").Controls("Zip Code")
.BorderStyle = 3 ' Short dashed border.
MsgBox "BorderStyle = " & .BorderStyle & vbCrLf & _
"OldBorderStyle = " & .OldBorderStyle ' Prints 3, 1.
.BorderStyle = 2 ' Dashed border.
MsgBox "BorderStyle = " & .BorderStyle & vbCrLf & _
"OldBorderStyle = " & .OldBorderStyle ' Prints 2, 1
.BorderStyle = .OldBorderStyle ' Solid (default) border.
MsgBox "BorderStyle = " & .BorderStyle & vbCrLf & _
"OldBorderStyle = " & .OldBorderStyle ' Prints 1, 1
End With