มี error ครับ
debug บรรทัดที่ 7(If Not IsNull...........)
Private Sub Combo18_AfterUpdate()
Call CheckS_Price
End Sub
Sub CheckS_Price()
Dim LastDate As String
Dim strPurchase_history As String
If Not IsNull(Me.date_sale) And Not IsNull(Me.goods_id) And Not IsNull(Forms!voucher_s!txtcust_id) Then
strPurchase_history = Nz(DLookup("[cust_id]", "[fsale]", "[goods_id] = '" & goods_id & "' And [cust_id] =" & Forms!voucher_s!txtcust_id & ""), 0)
LastDate = Nz(DLast("date_sale", "[fsale]", "[goods_id] = '" & goods_id & "' And [cust_id] =" & Forms!voucher_s!txtcust_id & ""), 0)
Me.s_price = Nz(DLookup("[s_price]", "[fsale]", "cstr([date_sale]) ='" & LastDate & "' And [goods_id] ='" & goods_id & "' And [cust_id] =" & Forms!voucher_s!txtcust_id & ""), 0)
End If
Call CheckS_Price
End Sub