0
strSQL = " SELECT W.wrhID, " & _
" W.wrhName AS WName " & _
" FROM tblWarehouse AS W " & _
" WHERE W.wrhID IN (" & Forms.frmStockControl.Form.txtwrhIDs & ")"
Set rst = CurrentDb.OpenRecordset(strSQL)
Do Until rst.EOF
Dim strlbl$, strlblV$
For i = 1 To rst.Fields.count
strlbl = "Me.lblWarehouse" & i
strlblV = "Me.lblWarehouse" & i
Me.Controls(strlbl).Caption = rst!WName
Me.Controls(strlblV).visible = True
Next
rst.MoveNext
Loop
我收到錯誤味精2465 - Can not find the Field name
找不到字段名稱
但場名稱在我的形式存在。
請幫忙。
哪條線調試高亮?我想你應該參考'txtwrhIDs'的不同。也許使用這個約定:'Forms!Mainform!ControlName'我也不認爲你可以通過'Me.Controls(Me.myControl)'方法獲得標題或可見性屬性。 –