hi this is my code that runs a Query on Update of a field the 2nd half is suppose to delete the query once information is removed which triggard the query to run but it doesnt reverse the query, i know my bottom half of the the code is wrong but i cant see where, please help me fix it.
Option Compare Database
Private Sub Product_AfterUpdate()
DoCmd.SetWarnings False
Me.Descriptions = Me.Product.Column(1)
Me.PartsPrice = Me.Product.Column(2)
If IsNull(Me.PartsPrice) Or Me.PartsPrice = "" Then
Me.PartsPrice = 0
End If
DoCmd.OpenQuery "QryQuotationAppendRR"
DoCmd.OpenQuery "QryQuotationAppendRR2"
DoCmd.OpenQuery "QryQuotationAppendPaint"
DoCmd.OpenQuery "QryQuotationAppendPaint2"
DoCmd.OpenQuery "QryQuotationAppendLabour"
DoCmd.OpenQuery "QryQuotationAppendLabour2"
DoCmd.OpenQuery "QryQuotationAppendOutwork"
DoCmd.Requery
Forms![Quotation]![QuotationDetails].SetFocus
DoCmd.SetWarnings True
If IsNull(Me.PartsPrice) Or Me.PartsPrice = "" Then
Me.PartsPrice = 0
End If
DoCmd.DeleteObject "QryQuotationAppendRR"
DoCmd.DeleteObject "QryQuotationAppendRR2"
DoCmd.DeleteObject "QryQuotationAppendPaint"
DoCmd.DeleteObject "QryQuotationAppendPaint2"
DoCmd.DeleteObject "QryQuotationAppendLabour"
DoCmd.DeleteObject "QryQuotationAppendLabour2"
DoCmd.DeleteObject "QryQuotationAppendOutwork"
Forms![Quotation]![QuotationDetails].SetFocus
DoCmd.SetWarnings True
End Sub
Option Compare Database
Private Sub Product_AfterUpdate()
DoCmd.SetWarnings False
Me.Descriptions = Me.Product.Column(1)
Me.PartsPrice = Me.Product.Column(2)
If IsNull(Me.PartsPrice) Or Me.PartsPrice = "" Then
Me.PartsPrice = 0
End If
DoCmd.OpenQuery "QryQuotationAppendRR"
DoCmd.OpenQuery "QryQuotationAppendRR2"
DoCmd.OpenQuery "QryQuotationAppendPaint"
DoCmd.OpenQuery "QryQuotationAppendPaint2"
DoCmd.OpenQuery "QryQuotationAppendLabour"
DoCmd.OpenQuery "QryQuotationAppendLabour2"
DoCmd.OpenQuery "QryQuotationAppendOutwork"
DoCmd.Requery
Forms![Quotation]![QuotationDetails].SetFocus
DoCmd.SetWarnings True
If IsNull(Me.PartsPrice) Or Me.PartsPrice = "" Then
Me.PartsPrice = 0
End If
DoCmd.DeleteObject "QryQuotationAppendRR"
DoCmd.DeleteObject "QryQuotationAppendRR2"
DoCmd.DeleteObject "QryQuotationAppendPaint"
DoCmd.DeleteObject "QryQuotationAppendPaint2"
DoCmd.DeleteObject "QryQuotationAppendLabour"
DoCmd.DeleteObject "QryQuotationAppendLabour2"
DoCmd.DeleteObject "QryQuotationAppendOutwork"
Forms![Quotation]![QuotationDetails].SetFocus
DoCmd.SetWarnings True
End Sub