Argument Not Optional when emailing an order

It is easier to add the code tags in the Advanced Editor by highlighting the code and clicking the # button.

Unfortunately Bob locked the tread or I would have added that instruction. I suggested this addition to Bob but was ignored.
I actually find it easier to write the tags myself at the start. But in a case like this - where the code has already been written - the tag button is visible when you edit the post. Send Bob a reminder to see if he will respond :)

grapevine: I just noticed that the IsNull() line I changed will only work for OR cases so change it back to individual IsNulls:
Code:
        If Not IsNull(!ItemDescription) AND Not IsNull(!ItemQty) AND Not IsNull(!LineTotalExcVat) Then
 
If you are calling the code from within the form you can reduce the code to read as follows:

Code:
If Not IsNull(Me.ItemDescription) And Not IsNull(Me.ItemQty) And Not IsNull(Me.LineTotalExcVat) Then 
      strBody = strBody & vbCrLf & Me.ItemDescription & " " & Me.ItemQty & " " & Me.LineTotalExcVatLineTotalExcVat

call CreateOrdersEmail (strMsgAddress, strSubject, strBody, True)

End If

Me!Ordersitem.Form!LineTotalExcVatLineTotalExcVat

Also not that one th line above you hav 2 ! (bangs) inconsistent with you early code.

Again is LineTotalExcVatLineTotalExcVat the actual field name?
 
If you are calling the code from within the form you can reduce the code to read as follows:

Code:
If Not IsNull(Me.ItemDescription) And Not IsNull(Me.ItemQty) And Not IsNull(Me.LineTotalExcVat) Then 
      strBody = strBody & vbCrLf & Me.ItemDescription & " "  & Me.ItemQty & " " & Me.LineTotalExcVatLineTotalExcVat

call CreateOrdersEmail (strMsgAddress, strSubject, strBody, True)

End If
Those fields are being read from a recordset. See post #17.
 
Thats what happens if you don't read all the threads correctly and skip to the end.
 
Thats what happens if you don't read all the threads correctly and skip to the end.
Lol but it's still worth the OP knowing though. The fields are actually in a subform so it might be also worht pointing that when referring to fields in a subform you don't need to include .Form unless you're referring to the subform's form's property or method. If that makes sense :confused:
 

Users who are viewing this thread

Back
Top Bottom