0
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

谢谢,

鲍勃·P

4

1 回答 1

0

您必须输入符号“&”。请参阅下面的示例。

strResultDesc = DLookup("Description", "[products/stock]", "[Product Code] =" & Me.txtResultPC.Value)
于 2012-10-08T11:46:00.373 回答