View Single Post
  #4  
Old March 14th, 2010, 06:34 PM posted to microsoft.public.access.reports
Ken Snell
external usenet poster
 
Posts: 177
Default Wrong amount of arguments!

Sorry, I am not seeing anything in the VBA code where it appears logical for
the expression to be inserted? Could you provide more information? Is this
expression meant to replace one of the fields currently in your string? Or
to be a new field in the string?

--

Ken Snell
http://www.accessmvp.com/KDSnell/


"Bob Vance" wrote in message
...

"Ken Snell" wrote in message
...
Not sure I'm following comletely correctly, but perhaps this is what you
seek:

IIf(Len(tblInvoice.ClientDetail & "") = 0, IIf(Len(tblInvoice.HorseName &
"") = 0, funGetHorseName(tblInvoice.InvoiceID, tblInvoice.HorseID),
tblInvoice.HorseName), tblInvoice.ClientDetail)

--

Ken Snell
http://www.accessmvp.com/KDSnell/


Thanks Ken, How do I incorerate it into this string....Regards Bob

Private Sub Report_Open(Cancel As Integer)

Me.Caption = "Monthly Horse Invoice Report"

Dim strSQL As String

strSQL = "SELECT tblInvoice.InvoiceDate, tblInvoice.InvoiceNo," _
& "tblInvoice.OwnerName, tblInvoice.TotalAmount," _
& "tblInvoice.OwnerPercentAmount FROM tblInvoice WHERE" _
& " tblInvoice.OwnerID=Forms!frmMonthlyClientInvoice!c bHorseName.value" _
& " AND tblInvoice.InvoiceDate=" &
Format("Forms!frmMonthlyClientInvoice!tbDateFrom.v alue", "mm/dd/yyyy") _
& " AND tblInvoice.InvoiceDate=" &
Format("Forms!frmMonthlyClientInvoice!tbDateTo.val ue", "mm/dd/yyyy") & ";"
Report.RecordSource = strSQL


End Sub