Private Sub command1_click()
f = 0
For n = 1 To 10 Step 2
f = f + n
Next n
Me!lbl.Caption = f
End Sub
单击命令按钮后,标签显示的结果是:
答案是25。
我按照题目建立了窗体和按钮,按钮名(caption)lbl, name为command1,然后输入代码,完成后按按钮,却出现如下错误提示:
“run time error '2465'
Microsoft Office Access can't fine the field 'lbl' referred to in your expression."