PC Review


Reply
Thread Tools Rate Thread

Wrong amount of arguments!

 
 
Bob Vance
Guest
Posts: n/a
 
      13th Mar 2010
What I want is tblInvoice.ClientDetail but if blank tblInvoice.HorseName but
if blank
funGetHorseName(tblInvoice.InvoiceID,tblInvoice.HorseID),tblInvoice.HorseName)

& "iif(tblInvoice.ClientDetail='',tblInvoice.HorseName='
',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


 
Reply With Quote
 
 
 
 
Ken Snell
Guest
Posts: n/a
 
      13th Mar 2010
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" <(E-Mail Removed)> wrote in message
news:hnf781$kve$(E-Mail Removed)...
> What I want is tblInvoice.ClientDetail but if blank tblInvoice.HorseName
> but if blank
> funGetHorseName(tblInvoice.InvoiceID,tblInvoice.HorseID),tblInvoice.HorseName)
>
> & "iif(tblInvoice.ClientDetail='',tblInvoice.HorseName='
> ',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
>
>



 
Reply With Quote
 
 
 
 
Bob Vance
Guest
Posts: n/a
 
      13th Mar 2010

"Ken Snell" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!cbHorseName.value" _
& " AND tblInvoice.InvoiceDate>=" &
Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
& " AND tblInvoice.InvoiceDate<=" &
Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
Report.RecordSource = strSQL


End Sub


 
Reply With Quote
 
Ken Snell
Guest
Posts: n/a
 
      14th Mar 2010
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" <(E-Mail Removed)> wrote in message
news:hngt2u$kns$(E-Mail Removed)...
>
> "Ken Snell" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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!cbHorseName.value" _
> & " AND tblInvoice.InvoiceDate>=" &
> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
> & " AND tblInvoice.InvoiceDate<=" &
> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
> Report.RecordSource = strSQL
>
>
> End Sub
>
>



 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      14th Mar 2010
Thanks Ken, my Original code for reporting Invoices for horses is below I am
trying to create a code for reporting Invoices for Clients
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," _
& "iif(tblInvoice.HorseName='
',funGetHorseName(tblInvoice.InvoiceID,tblInvoice.HorseID),tblInvoice.HorseName)
AS HorseName," _
& "tblInvoice.OwnerPercentAmount FROM tblInvoice WHERE" _
& " tblInvoice.HorseID=Forms!frmMonthlyHorseInvoice!cbHorseName.value" _
& " AND tblInvoice.InvoiceDate>=" &
Format("Forms!frmMonthlyHorseInvoice!tbDateFrom.value", "mm/dd/yyyy") _
& " AND tblInvoice.InvoiceDate<=" &
Format("Forms!frmMonthlyHorseInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
Report.RecordSource = strSQL

End Sub
-------------------------------------------------------
My Code for Client reporting Invoices!

Private Sub Report_Open(Cancel As Integer)

Me.Caption = "Monthly Client 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!cbClientName.value" _
& "IIf(Len(tblInvoice.ClientDetail & "") = 0, IIf(Len(tblInvoice.HorseName &
"") = 0, funGetHorseName(tblInvoice.InvoiceID,
tblInvoice.HorseID),tblInvoice.HorseName), tblInvoice.ClientDetail)" _
& " AND tblInvoice.InvoiceDate>=" &
Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
& " AND tblInvoice.InvoiceDate<=" &
Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
Report.RecordSource = strSQL

End Sub



"Ken Snell" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:hngt2u$kns$(E-Mail Removed)...
>>
>> "Ken Snell" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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!cbHorseName.value" _
>> & " AND tblInvoice.InvoiceDate>=" &
>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>> & " AND tblInvoice.InvoiceDate<=" &
>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>> ";"
>> Report.RecordSource = strSQL
>>
>>
>> End Sub
>>
>>

>
>



 
Reply With Quote
 
Ken Snell
Guest
Posts: n/a
 
      15th Mar 2010
Assuming you want that calculated field for which I gave the expression to
be in the SELECT clause (watch for the mutiple, consecutive " characters):

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!cbClientName.value" _
& " AND tblInvoice.InvoiceDate>=" & _
Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
& " AND tblInvoice.InvoiceDate<=" & _
Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
--

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



"Bob Vance" <(E-Mail Removed)> wrote in message
news:hnjj85$7a0$(E-Mail Removed)...
> Thanks Ken, my Original code for reporting Invoices for horses is below I
> am trying to create a code for reporting Invoices for Clients
> 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," _
> & "iif(tblInvoice.HorseName='
> ',funGetHorseName(tblInvoice.InvoiceID,tblInvoice.HorseID),tblInvoice.HorseName)
> AS HorseName," _
> & "tblInvoice.OwnerPercentAmount FROM tblInvoice WHERE" _
> & " tblInvoice.HorseID=Forms!frmMonthlyHorseInvoice!cbHorseName.value" _
> & " AND tblInvoice.InvoiceDate>=" &
> Format("Forms!frmMonthlyHorseInvoice!tbDateFrom.value", "mm/dd/yyyy") _
> & " AND tblInvoice.InvoiceDate<=" &
> Format("Forms!frmMonthlyHorseInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
> Report.RecordSource = strSQL
>
> End Sub
> -------------------------------------------------------
> My Code for Client reporting Invoices!
>
> Private Sub Report_Open(Cancel As Integer)
>
> Me.Caption = "Monthly Client 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!cbClientName.value" _
> & "IIf(Len(tblInvoice.ClientDetail & "") = 0, IIf(Len(tblInvoice.HorseName
> & "") = 0, funGetHorseName(tblInvoice.InvoiceID,
> tblInvoice.HorseID),tblInvoice.HorseName), tblInvoice.ClientDetail)" _
> & " AND tblInvoice.InvoiceDate>=" &
> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
> & " AND tblInvoice.InvoiceDate<=" &
> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
> Report.RecordSource = strSQL
>
> End Sub
>
>
>
> "Ken Snell" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:hngt2u$kns$(E-Mail Removed)...
>>>
>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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!cbHorseName.value"
>>> _
>>> & " AND tblInvoice.InvoiceDate>=" &
>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>>> & " AND tblInvoice.InvoiceDate<=" &
>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>> ";"
>>> Report.RecordSource = strSQL
>>>
>>>
>>> End Sub
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      15th Mar 2010
Ken I am getting this error
The database engine can not find..........Thanks Bob
"IIf(Len(tblInvoice.ClientDetail & """") = 0, IIf(Len(tblInvoice.HorseName &
"" & """") = 0, funGetHorseName(tblInvoice.InvoiceID, tblInvoice.HorseID), "
& _
"tblInvoice.HorseName), tblInvoice.ClientDetail) AS ClientDetailField" & _
" FROM tblInvoice WHERE" _


"Ken Snell" <(E-Mail Removed)> wrote in message
news:O3$k04%(E-Mail Removed)...
> Assuming you want that calculated field for which I gave the expression to
> be in the SELECT clause (watch for the mutiple, consecutive " characters):
>
> 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!cbClientName.value" _
> & " AND tblInvoice.InvoiceDate>=" & _
> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
> & " AND tblInvoice.InvoiceDate<=" & _
> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
> --
>
> Ken Snell
> http://www.accessmvp.com/KDSnell/
>
>
>
> "Bob Vance" <(E-Mail Removed)> wrote in message
> news:hnjj85$7a0$(E-Mail Removed)...
>> Thanks Ken, my Original code for reporting Invoices for horses is below I
>> am trying to create a code for reporting Invoices for Clients
>> 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," _
>> & "iif(tblInvoice.HorseName='
>> ',funGetHorseName(tblInvoice.InvoiceID,tblInvoice.HorseID),tblInvoice.HorseName)
>> AS HorseName," _
>> & "tblInvoice.OwnerPercentAmount FROM tblInvoice WHERE" _
>> & " tblInvoice.HorseID=Forms!frmMonthlyHorseInvoice!cbHorseName.value" _
>> & " AND tblInvoice.InvoiceDate>=" &
>> Format("Forms!frmMonthlyHorseInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>> & " AND tblInvoice.InvoiceDate<=" &
>> Format("Forms!frmMonthlyHorseInvoice!tbDateTo.value", "mm/dd/yyyy") & ";"
>> Report.RecordSource = strSQL
>>
>> End Sub
>> -------------------------------------------------------
>> My Code for Client reporting Invoices!
>>
>> Private Sub Report_Open(Cancel As Integer)
>>
>> Me.Caption = "Monthly Client 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!cbClientName.value"
>> _
>> & "IIf(Len(tblInvoice.ClientDetail & "") = 0,
>> IIf(Len(tblInvoice.HorseName & "") = 0,
>> funGetHorseName(tblInvoice.InvoiceID,
>> tblInvoice.HorseID),tblInvoice.HorseName), tblInvoice.ClientDetail)" _
>> & " AND tblInvoice.InvoiceDate>=" &
>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>> & " AND tblInvoice.InvoiceDate<=" &
>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>> ";"
>> Report.RecordSource = strSQL
>>
>> End Sub
>>
>>
>>
>> "Ken Snell" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:hngt2u$kns$(E-Mail Removed)...
>>>>
>>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> 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!cbHorseName.value"
>>>> _
>>>> & " AND tblInvoice.InvoiceDate>=" &
>>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy")
>>>> _
>>>> & " AND tblInvoice.InvoiceDate<=" &
>>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>>> ";"
>>>> Report.RecordSource = strSQL
>>>>
>>>>
>>>> End Sub
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Ken Snell
Guest
Posts: n/a
 
      16th Mar 2010
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!cbClientName.value" _
& " AND tblInvoice.InvoiceDate>=" & _
Format(Forms!frmMonthlyClientInvoice!tbDateFrom.value, _
"\#mm\/dd\/yyyy\#") _
& " AND tblInvoice.InvoiceDate<=" & _
Format(Forms!frmMonthlyClientInvoice!tbDateTo.value, _
"\#mm\/dd\/yyyy\#") ") & ";"

--

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



"Bob Vance" <(E-Mail Removed)> wrote in message
news:hnlqfo$h95$(E-Mail Removed)...
> Ken I am getting this error
> The database engine can not find..........Thanks Bob
> "IIf(Len(tblInvoice.ClientDetail & """") = 0, IIf(Len(tblInvoice.HorseName
> & "" & """") = 0, funGetHorseName(tblInvoice.InvoiceID,
> tblInvoice.HorseID), " & _
> "tblInvoice.HorseName), tblInvoice.ClientDetail) AS ClientDetailField" & _
> " FROM tblInvoice WHERE" _
>
>
> "Ken Snell" <(E-Mail Removed)> wrote in message
> news:O3$k04%(E-Mail Removed)...
>> Assuming you want that calculated field for which I gave the expression
>> to be in the SELECT clause (watch for the mutiple, consecutive "
>> characters):
>>
>> 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!cbClientName.value"
>> _
>> & " AND tblInvoice.InvoiceDate>=" & _
>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>> & " AND tblInvoice.InvoiceDate<=" & _
>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>> ";"
>> --
>>
>> Ken Snell
>> http://www.accessmvp.com/KDSnell/
>>
>>
>>
>> "Bob Vance" <(E-Mail Removed)> wrote in message
>> news:hnjj85$7a0$(E-Mail Removed)...
>>> Thanks Ken, my Original code for reporting Invoices for horses is below
>>> I am trying to create a code for reporting Invoices for Clients
>>> 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," _
>>> & "iif(tblInvoice.HorseName='
>>> ',funGetHorseName(tblInvoice.InvoiceID,tblInvoice.HorseID),tblInvoice.HorseName)
>>> AS HorseName," _
>>> & "tblInvoice.OwnerPercentAmount FROM tblInvoice WHERE" _
>>> & " tblInvoice.HorseID=Forms!frmMonthlyHorseInvoice!cbHorseName.value" _
>>> & " AND tblInvoice.InvoiceDate>=" &
>>> Format("Forms!frmMonthlyHorseInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>>> & " AND tblInvoice.InvoiceDate<=" &
>>> Format("Forms!frmMonthlyHorseInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>> ";"
>>> Report.RecordSource = strSQL
>>>
>>> End Sub
>>> -------------------------------------------------------
>>> My Code for Client reporting Invoices!
>>>
>>> Private Sub Report_Open(Cancel As Integer)
>>>
>>> Me.Caption = "Monthly Client 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!cbClientName.value"
>>> _
>>> & "IIf(Len(tblInvoice.ClientDetail & "") = 0,
>>> IIf(Len(tblInvoice.HorseName & "") = 0,
>>> funGetHorseName(tblInvoice.InvoiceID,
>>> tblInvoice.HorseID),tblInvoice.HorseName), tblInvoice.ClientDetail)" _
>>> & " AND tblInvoice.InvoiceDate>=" &
>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>>> & " AND tblInvoice.InvoiceDate<=" &
>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>> ";"
>>> Report.RecordSource = strSQL
>>>
>>> End Sub
>>>
>>>
>>>
>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>> 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" <(E-Mail Removed)> wrote in message
>>>> news:hngt2u$kns$(E-Mail Removed)...
>>>>>
>>>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> 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!cbHorseName.value" _
>>>>> & " AND tblInvoice.InvoiceDate>=" &
>>>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy")
>>>>> _
>>>>> & " AND tblInvoice.InvoiceDate<=" &
>>>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>>>> ";"
>>>>> Report.RecordSource = strSQL
>>>>>
>>>>>
>>>>> End Sub
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      16th Mar 2010
Ken i am getting a error ' expect end of statement on -> ")& "
4 of the last six symbols
Thanks bob
"Ken Snell" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!cbClientName.value" _
> & " AND tblInvoice.InvoiceDate>=" & _
> Format(Forms!frmMonthlyClientInvoice!tbDateFrom.value, _
> "\#mm\/dd\/yyyy\#") _
> & " AND tblInvoice.InvoiceDate<=" & _
> Format(Forms!frmMonthlyClientInvoice!tbDateTo.value, _
> "\#mm\/dd\/yyyy\#") ") & ";"
>
> --
>
> Ken Snell
> http://www.accessmvp.com/KDSnell/
>
>
>
> "Bob Vance" <(E-Mail Removed)> wrote in message
> news:hnlqfo$h95$(E-Mail Removed)...
>> Ken I am getting this error
>> The database engine can not find..........Thanks Bob
>> "IIf(Len(tblInvoice.ClientDetail & """") = 0,
>> IIf(Len(tblInvoice.HorseName & "" & """") = 0,
>> funGetHorseName(tblInvoice.InvoiceID, tblInvoice.HorseID), " & _
>> "tblInvoice.HorseName), tblInvoice.ClientDetail) AS ClientDetailField" &
>> _
>> " FROM tblInvoice WHERE" _
>>
>>
>> "Ken Snell" <(E-Mail Removed)> wrote in message
>> news:O3$k04%(E-Mail Removed)...
>>> Assuming you want that calculated field for which I gave the expression
>>> to be in the SELECT clause (watch for the mutiple, consecutive "
>>> characters):
>>>
>>> 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!cbClientName.value"
>>> _
>>> & " AND tblInvoice.InvoiceDate>=" & _
>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>>> & " AND tblInvoice.InvoiceDate<=" & _
>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>> ";"
>>> --
>>>
>>> Ken Snell
>>> http://www.accessmvp.com/KDSnell/
>>>
>>>
>>>
>>> "Bob Vance" <(E-Mail Removed)> wrote in message
>>> news:hnjj85$7a0$(E-Mail Removed)...
>>>> Thanks Ken, my Original code for reporting Invoices for horses is below
>>>> I am trying to create a code for reporting Invoices for Clients
>>>> 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," _
>>>> & "iif(tblInvoice.HorseName='
>>>> ',funGetHorseName(tblInvoice.InvoiceID,tblInvoice.HorseID),tblInvoice.HorseName)
>>>> AS HorseName," _
>>>> & "tblInvoice.OwnerPercentAmount FROM tblInvoice WHERE" _
>>>> & " tblInvoice.HorseID=Forms!frmMonthlyHorseInvoice!cbHorseName.value"
>>>> _
>>>> & " AND tblInvoice.InvoiceDate>=" &
>>>> Format("Forms!frmMonthlyHorseInvoice!tbDateFrom.value", "mm/dd/yyyy") _
>>>> & " AND tblInvoice.InvoiceDate<=" &
>>>> Format("Forms!frmMonthlyHorseInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>>> ";"
>>>> Report.RecordSource = strSQL
>>>>
>>>> End Sub
>>>> -------------------------------------------------------
>>>> My Code for Client reporting Invoices!
>>>>
>>>> Private Sub Report_Open(Cancel As Integer)
>>>>
>>>> Me.Caption = "Monthly Client 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!cbClientName.value" _
>>>> & "IIf(Len(tblInvoice.ClientDetail & "") = 0,
>>>> IIf(Len(tblInvoice.HorseName & "") = 0,
>>>> funGetHorseName(tblInvoice.InvoiceID,
>>>> tblInvoice.HorseID),tblInvoice.HorseName), tblInvoice.ClientDetail)" _
>>>> & " AND tblInvoice.InvoiceDate>=" &
>>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy")
>>>> _
>>>> & " AND tblInvoice.InvoiceDate<=" &
>>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>>> ";"
>>>> Report.RecordSource = strSQL
>>>>
>>>> End Sub
>>>>
>>>>
>>>>
>>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>>> news:%(E-Mail Removed)...
>>>>> 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" <(E-Mail Removed)> wrote in message
>>>>> news:hngt2u$kns$(E-Mail Removed)...
>>>>>>
>>>>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>>>>> news:(E-Mail Removed)...
>>>>>>> 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!cbHorseName.value" _
>>>>>> & " AND tblInvoice.InvoiceDate>=" &
>>>>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value",
>>>>>> "mm/dd/yyyy") _
>>>>>> & " AND tblInvoice.InvoiceDate<=" &
>>>>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy")
>>>>>> & ";"
>>>>>> Report.RecordSource = strSQL
>>>>>>
>>>>>>
>>>>>> End Sub
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      16th Mar 2010
Thanks Ken got it going now, just gatting a parameter error on ClientDetail
Will try and work it out
Regards Bob

"Bob Vance" <(E-Mail Removed)> wrote in message
news:hnn74i$bik$(E-Mail Removed)...
> Ken i am getting a error ' expect end of statement on -> ")& "
> 4 of the last six symbols
> Thanks bob
> "Ken Snell" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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!cbClientName.value"
>> _
>> & " AND tblInvoice.InvoiceDate>=" & _
>> Format(Forms!frmMonthlyClientInvoice!tbDateFrom.value, _
>> "\#mm\/dd\/yyyy\#") _
>> & " AND tblInvoice.InvoiceDate<=" & _
>> Format(Forms!frmMonthlyClientInvoice!tbDateTo.value, _
>> "\#mm\/dd\/yyyy\#") ") & ";"
>>
>> --
>>
>> Ken Snell
>> http://www.accessmvp.com/KDSnell/
>>
>>
>>
>> "Bob Vance" <(E-Mail Removed)> wrote in message
>> news:hnlqfo$h95$(E-Mail Removed)...
>>> Ken I am getting this error
>>> The database engine can not find..........Thanks Bob
>>> "IIf(Len(tblInvoice.ClientDetail & """") = 0,
>>> IIf(Len(tblInvoice.HorseName & "" & """") = 0,
>>> funGetHorseName(tblInvoice.InvoiceID, tblInvoice.HorseID), " & _
>>> "tblInvoice.HorseName), tblInvoice.ClientDetail) AS ClientDetailField" &
>>> _
>>> " FROM tblInvoice WHERE" _
>>>
>>>
>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>> news:O3$k04%(E-Mail Removed)...
>>>> Assuming you want that calculated field for which I gave the expression
>>>> to be in the SELECT clause (watch for the mutiple, consecutive "
>>>> characters):
>>>>
>>>> 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!cbClientName.value" _
>>>> & " AND tblInvoice.InvoiceDate>=" & _
>>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy")
>>>> _
>>>> & " AND tblInvoice.InvoiceDate<=" & _
>>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>>> ";"
>>>> --
>>>>
>>>> Ken Snell
>>>> http://www.accessmvp.com/KDSnell/
>>>>
>>>>
>>>>
>>>> "Bob Vance" <(E-Mail Removed)> wrote in message
>>>> news:hnjj85$7a0$(E-Mail Removed)...
>>>>> Thanks Ken, my Original code for reporting Invoices for horses is
>>>>> below I am trying to create a code for reporting Invoices for Clients
>>>>> 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," _
>>>>> & "iif(tblInvoice.HorseName='
>>>>> ',funGetHorseName(tblInvoice.InvoiceID,tblInvoice.HorseID),tblInvoice.HorseName)
>>>>> AS HorseName," _
>>>>> & "tblInvoice.OwnerPercentAmount FROM tblInvoice WHERE" _
>>>>> & " tblInvoice.HorseID=Forms!frmMonthlyHorseInvoice!cbHorseName.value"
>>>>> _
>>>>> & " AND tblInvoice.InvoiceDate>=" &
>>>>> Format("Forms!frmMonthlyHorseInvoice!tbDateFrom.value", "mm/dd/yyyy")
>>>>> _
>>>>> & " AND tblInvoice.InvoiceDate<=" &
>>>>> Format("Forms!frmMonthlyHorseInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>>>> ";"
>>>>> Report.RecordSource = strSQL
>>>>>
>>>>> End Sub
>>>>> -------------------------------------------------------
>>>>> My Code for Client reporting Invoices!
>>>>>
>>>>> Private Sub Report_Open(Cancel As Integer)
>>>>>
>>>>> Me.Caption = "Monthly Client 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!cbClientName.value" _
>>>>> & "IIf(Len(tblInvoice.ClientDetail & "") = 0,
>>>>> IIf(Len(tblInvoice.HorseName & "") = 0,
>>>>> funGetHorseName(tblInvoice.InvoiceID,
>>>>> tblInvoice.HorseID),tblInvoice.HorseName), tblInvoice.ClientDetail)" _
>>>>> & " AND tblInvoice.InvoiceDate>=" &
>>>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value", "mm/dd/yyyy")
>>>>> _
>>>>> & " AND tblInvoice.InvoiceDate<=" &
>>>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy") &
>>>>> ";"
>>>>> Report.RecordSource = strSQL
>>>>>
>>>>> End Sub
>>>>>
>>>>>
>>>>>
>>>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>>>> news:%(E-Mail Removed)...
>>>>>> 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" <(E-Mail Removed)> wrote in message
>>>>>> news:hngt2u$kns$(E-Mail Removed)...
>>>>>>>
>>>>>>> "Ken Snell" <(E-Mail Removed)> wrote in message
>>>>>>> news:(E-Mail Removed)...
>>>>>>>> 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!cbHorseName.value"
>>>>>>> _
>>>>>>> & " AND tblInvoice.InvoiceDate>=" &
>>>>>>> Format("Forms!frmMonthlyClientInvoice!tbDateFrom.value",
>>>>>>> "mm/dd/yyyy") _
>>>>>>> & " AND tblInvoice.InvoiceDate<=" &
>>>>>>> Format("Forms!frmMonthlyClientInvoice!tbDateTo.value", "mm/dd/yyyy")
>>>>>>> & ";"
>>>>>>> Report.RecordSource = strSQL
>>>>>>>
>>>>>>>
>>>>>>> End Sub
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Calculated Field (wrong Qty*Price = wrong Amount) =?Utf-8?B?RWRtdW5k?= Microsoft Excel Misc 8 4th Oct 2007 12:13 PM
How do I calculate Amount of Sales Tax from Total Amount? =?Utf-8?B?TWlrZVM=?= Microsoft Excel Worksheet Functions 1 26th Mar 2005 08:49 PM
Can you convert an amount to a spelled out amount as used in prin. =?Utf-8?B?bWlrZXM=?= Microsoft Excel Worksheet Functions 1 15th Oct 2004 06:27 PM
Need to reduce amount when another amount is entered johnathon Microsoft Excel Worksheet Functions 1 7th Nov 2003 12:47 PM
how to transit amount in figures into amount in words garfunkel Microsoft Excel Misc 4 20th Jul 2003 12:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:16 AM.