If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Wrong amount of arguments!
What I want is tblInvoice.ClientDetail but if blank tblInvoice.HorseName but
if blank funGetHorseName(tblInvoice.InvoiceID,tblInvoice.Ho rseID),tblInvoice.HorseName) & "iif(tblInvoice.ClientDetail='',tblInvoice.HorseNa me=' ',funGetHorseName(tblInvoice.InvoiceID,tblInvoice. HorseID),tblInvoice.HorseName) AS ClientDetail," _ -- Thanks in advance for any help with this......Bob MS Access 2007 accdb Windows XP Home Edition Ver 5.1 Service Pack 3 |
#2
|
|||
|
|||
Wrong amount of arguments!
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/ "Bob Vance" wrote in message ... What I want is tblInvoice.ClientDetail but if blank tblInvoice.HorseName but if blank funGetHorseName(tblInvoice.InvoiceID,tblInvoice.Ho rseID),tblInvoice.HorseName) & "iif(tblInvoice.ClientDetail='',tblInvoice.HorseNa me=' ',funGetHorseName(tblInvoice.InvoiceID,tblInvoice. HorseID),tblInvoice.HorseName) AS ClientDetail," _ -- Thanks in advance for any help with this......Bob MS Access 2007 accdb Windows XP Home Edition Ver 5.1 Service Pack 3 |
#3
|
|||
|
|||
Wrong amount of arguments!
"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 |
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
Wrong amount of arguments!
You're welcome. Glad you were able to "fix" those last few items!
-- Ken Snell http://www.accessmvp.com/KDSnell/ "Bob Vance" wrote in message ... Got it changed AS ClientDetailField" to AS ClientDetail" Brilliant thanks Bob "Bob Vance" wrote in message ... Thanks Ken got it going now, just gatting a parameter error on ClientDetail Will try and work it out Regards Bob "Bob Vance" wrote in message ... Ken i am getting a error ' expect end of statement on - ")& " 4 of the last six symbols Thanks bob "Ken Snell" wrote in message ... Try this: strSQL = "SELECT tblInvoice.InvoiceDate, tblInvoice.InvoiceNo," _ & "tblInvoice.OwnerName, tblInvoice.TotalAmount," _ & "tblInvoice.OwnerPercentAmount, " & _ "IIf(Len(tblInvoice.ClientDetail & """") = 0, " & _ "IIf(Len(tblInvoice.HorseName & " & _ """"") = 0, funGetHorseName(tblInvoice.InvoiceID, tblInvoice.HorseID), " & _ "tblInvoice.HorseName), tblInvoice.ClientDetail) AS ClientDetailField" & _ " FROM tblInvoice WHERE" _ & " tblInvoice.OwnerID=Forms!frmMonthlyClientInvoice!c bClientName.value" _ & " AND tblInvoice.InvoiceDate=" & _ Format(Forms!frmMonthlyClientInvoice!tbDateFrom.va lue, _ "\#mm\/dd\/yyyy\#") _ & " AND tblInvoice.InvoiceDate=" & _ Format(Forms!frmMonthlyClientInvoice!tbDateTo.valu e, _ "\#mm\/dd\/yyyy\#") ") & ";" -- Ken Snell http://www.accessmvp.com/KDSnell/ |
Thread Tools | |
Display Modes | |
|
|