Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ms access 如何在access中将文本框的多个值从一个窗体传递到另一个窗体_Ms Access - Fatal编程技术网

Ms access 如何在access中将文本框的多个值从一个窗体传递到另一个窗体

Ms access 如何在access中将文本框的多个值从一个窗体传递到另一个窗体,ms-access,Ms Access,我的库存数据库中有两个用于购买和销售的表单。有时我需要在购买表单中直接显示“从购买到销售”。我还见过其他类似的问题,这些问题不能解决我的问题。我还尝试了以下方法: Option Compare Database Private Sub Command25_Click() MsgBox "Are you sure to show this purchase as direct sale?", vbYesNo, "Direct Sale" I

我的库存数据库中有两个用于购买和销售的表单。有时我需要在购买表单中直接显示“从购买到销售”。我还见过其他类似的问题,这些问题不能解决我的问题。我还尝试了以下方法:

Option Compare Database

Private Sub Command25_Click()
    MsgBox "Are you sure to show this purchase as direct sale?", vbYesNo, "Direct Sale"
    If vbYes Then
    DoCmd.OpenForm "SF02PurchasetoSale", acNormal, , , , , DirectSale
           
    End If
       
End Sub

Private Sub DirectSale()
    Forms![SF02PurchasetoSale].[TxnDate] = Me.TxnDate.Value
    Forms![SF02PurchasetoSale].[Hub] = Me.Hub.Value
    Forms![SF02PurchasetoSale].[Code] = Me.Code.Value
    Forms![SF02PurchasetoSale].[PurchasePrice] = Me.PurchasePrice.Value
    Forms![SF02PurchasetoSale].[QtySold] = Me.QuantityPurchased.Value
    
End Sub

这显示了DirectSale的openargs上的“编译错误:预期的函数或变量”。我真的需要一些帮助。谢谢…

OpenArgs将值传递给OpenForm或OpenReport命令中指定的窗体或报表。考虑:

DoCmd.OpenForm“SF02PurchasetoSale”、acNormal、、acFormAdd、“DirectSale”

然后,SF02PurchasetoSale后面的代码:

Private Sub Form_Load()
With Me
If .OpenArgs = "DirectSale" Then
    .[TxnDate] = Forms!Purchases.TxnDate
    .[Hub] = Forms!Purchases.Hub
    .[Code] = Forms!Purchases.Code
    .[PurchasePrice] = Forms!Purchases.PurchasePrice
    .[QtySold] = Forms!Purchases.QuantityPurchased
End If
End With
End Sub

OpenArgs将值传递给OpenForm或OpenReport命令中指定的窗体或报表。考虑:

DoCmd.OpenForm“SF02PurchasetoSale”、acNormal、、acFormAdd、“DirectSale”

然后,SF02PurchasetoSale后面的代码:

Private Sub Form_Load()
With Me
If .OpenArgs = "DirectSale" Then
    .[TxnDate] = Forms!Purchases.TxnDate
    .[Hub] = Forms!Purchases.Hub
    .[Code] = Forms!Purchases.Code
    .[PurchasePrice] = Forms!Purchases.PurchasePrice
    .[QtySold] = Forms!Purchases.QuantityPurchased
End If
End With
End Sub