ACC2000: Jumping into WITH Statement Blocks Is Not Allowed (210230)
The information in this article applies to:
This article was previously published under Q210230 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SUMMARY
The With statement enables you to perform a series of references to a specified object without having to repeat the name of the object. For
example, if you have a number of different properties to change on a single
object, it is more convenient to place the property assignment statements
inside the With control structure. In this manner, you have to refer to the object only once instead of having to refer to it with each property
assignment.
The following example illustrates the use of the With statement to assign values to several properties of the same object:
With MyLabel
.Height = 2000
.Width = 2000
.Caption = "This is MyLabel"
End With
The With statement behaves differently from other block structures in the Basic programming language. The With statement does not allow you to use a GoTo statement to enter the With/End With statement block. Other block structures like If/End If and Select Case/End Select in the Basic programming language support the GoTo statement.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbhowto kbinfo kbProgramming KB210230 |
---|
|