对文本框的多个属性进行设置,例如下面的代码:
Forms!frm生产计划.txt计划数量.FontBold = True
Forms!frm生产计划.txt计划数量.Enabled = True
Forms!frm生产计划.txt计划数量.Left = 100
Forms!frm生产计划.txt计划数量.Top = 100
可以使用 With...End With结构进行优化,优化后的代码如下:
With Forms!frm生产计划.txt计划数量
.FontBold = True
.Enabled = True
.Left = 100
.Top = 100
End With