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