Coding Problem

A

Amin

i have been tying to modify the sample databse for my business needs but a
few things aren't going right like the codes.

i have this code that let the invoice report show up in the sample databse
and i want to stop it from showing how can i doi it. thanks

Private Sub cmdCreateInvoice_Click()
Dim OrderID As Long
Dim InvoiceID As Long

OrderID = Nz(Me![Order ID], 0)

' Gracefully exit if invoice already created
If CustomerOrders.IsInvoiced(OrderID) Then
If MsgBoxYesNo(OrderAlreadyInvoiced) Then
CustomerOrders.PrintInvoice OrderID
End If
ElseIf ValidateOrder(Invoiced_CustomerOrder) Then

' Create Invoice Record
If CustomerOrders.CreateInvoice(OrderID, 0, InvoiceID) Then

' Mark all Order Items Invoiced
' Need to change Inventory Status to SOLD from HOLD
Dim rsw As New RecordsetWrapper
With rsw.GetRecordsetClone(Me.sbfOrderDetails.Form.Recordset)
While Not .EOF
If Not IsNull(![Inventory ID]) And ![Status ID] =
OnHold_OrderItemStatus Then
rsw.Edit
![Status ID] = Invoiced_OrderItemStatus
rsw.Update
Inventory.HoldToSold ![Inventory ID]
End If
rsw.MoveNext
Wend
End With

' Print the Invoice
CustomerOrders.PrintInvoice OrderID

SetFormState
End If
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top