I keep getting the error 2467 the expression you have entered refers to an object that is closed"
how do fix this
thanks
Private Sub CmdDelete_Click()
If IsNull(Me.CustomerNo) = True Then
If MsgBox("Press Yes to start a new order, Press No to go back to the Main Menu", vbYesNo) = vbYes Then
Me.CustomerNo.SetFocus
Me.CustomerNo.Dropdown
Else
DoCmd.OpenForm "frmMainMenu"
DoCmd.Close acForm, "frmMainOrder"
End If
End If
If IsNull(Me.CustomerNo) = False Then
If MsgBox("Press Yes to start a new order, Press No to go back to the Main Menu", vbYesNo) = vbYes Then
Me.Refresh
Dim strSQL1 As String
strSQL1 = "Delete* from tblInvoices Where InvoiceNo = " & CStr([InvoiceNo]) & ""
DoCmd.SetWarnings False
DoCmd.RunSQL (strSQL1)
DoCmd.SetWarnings True
Else
DoCmd.OpenForm "frmMainMenu"
DoCmd.Close acForm, "frmMainOrder"
End If
End If
End Sub
how do fix this
thanks
Private Sub CmdDelete_Click()
If IsNull(Me.CustomerNo) = True Then
If MsgBox("Press Yes to start a new order, Press No to go back to the Main Menu", vbYesNo) = vbYes Then
Me.CustomerNo.SetFocus
Me.CustomerNo.Dropdown
Else
DoCmd.OpenForm "frmMainMenu"
DoCmd.Close acForm, "frmMainOrder"
End If
End If
If IsNull(Me.CustomerNo) = False Then
If MsgBox("Press Yes to start a new order, Press No to go back to the Main Menu", vbYesNo) = vbYes Then
Me.Refresh
Dim strSQL1 As String
strSQL1 = "Delete* from tblInvoices Where InvoiceNo = " & CStr([InvoiceNo]) & ""
DoCmd.SetWarnings False
DoCmd.RunSQL (strSQL1)
DoCmd.SetWarnings True
Else
DoCmd.OpenForm "frmMainMenu"
DoCmd.Close acForm, "frmMainOrder"
End If
End If
End Sub