S
Sharon
When I run the code below it gives me the error that Method or Data Member
not found. I have compared the "frmExpenseReport" and they appear to be the
same as the "frmPurchaseOrder" as far as properties, etc. I added the
stDocName = "frmPurchaseOrder" because when the drop down opens the name
PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does? Why?
How do I fix this? What I am trying to do is that when the button is
clicked, depending on the value selected in another combo box, I want it to
open either one form (frmExpenseReport) or another (frmPurchaseOrder).
Thanks for any help.
Private Sub VIEW_REPORT_Click()
On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmExpenseReport"
stDocName = "frmPurchaseOrder"
If Me!cmbMethodofPayment = 1 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID
ElseIf Me!cmbMethodofPayment = 2 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID
ElseIf Me!cmbMethodofPayment = 3 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID
ElseIf Me!cmbMethodofPayment = 4 Then
DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = " &
Me.PurchaseOrderID
End If
-
S
not found. I have compared the "frmExpenseReport" and they appear to be the
same as the "frmPurchaseOrder" as far as properties, etc. I added the
stDocName = "frmPurchaseOrder" because when the drop down opens the name
PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does? Why?
How do I fix this? What I am trying to do is that when the button is
clicked, depending on the value selected in another combo box, I want it to
open either one form (frmExpenseReport) or another (frmPurchaseOrder).
Thanks for any help.
Private Sub VIEW_REPORT_Click()
On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmExpenseReport"
stDocName = "frmPurchaseOrder"
If Me!cmbMethodofPayment = 1 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID
ElseIf Me!cmbMethodofPayment = 2 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID
ElseIf Me!cmbMethodofPayment = 3 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID
ElseIf Me!cmbMethodofPayment = 4 Then
DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = " &
Me.PurchaseOrderID
End If
-
S