Private Sub Report_Open(Cancel As Integer)
Dim strResultDesc As String
strResultDesc = DLookup("Description", "[products/stock]", "[Product Code] = Me.txtResultPC.Value")
Text20.Value = strResultDesc
End Sub
这是我目前的代码,我收到一条错误消息,指出存在以下问题:
[Product Code] = Me.txtResultPC.Value
有人能发现什么吗?
更新:
也试过这种方法,
Private Sub Report_Open(Cancel As Integer)
Dim strResultDesc As String
strResultDesc = DLookup("Description", "[products/stock]", "[products/stock].[Product Code] = [Result PC]")
Me.Text20.Value = strResultDesc
End Sub
谢谢,
Bob P
答案 0 :(得分:0)
您必须添加符号“&”。请参阅下面的示例。
strResultDesc = DLookup("Description", "[products/stock]", "[Product Code] =" & Me.txtResultPC.Value)