| Home | Forums | Reviews | Articles | Register |
![]() |
| Thread Tools | Rate Thread |
|
|
|
| |
|
Ken Snell
Guest
Posts: n/a
|
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 > > |
|
||
|
||||
|
|
|
| |
|
Bob Vance
Guest
Posts: n/a
|
"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 |
|
||
|
||||
|
Ken Snell
Guest
Posts: n/a
|
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 > > |
|
||
|
||||
|
Bob Vance
Guest
Posts: n/a
|
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 >> >> > > |
|
||
|
||||
|
Ken Snell
Guest
Posts: n/a
|
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 >>> >>> >> >> > > |
|
||
|
||||
|
Bob Vance
Guest
Posts: n/a
|
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 >>>> >>>> >>> >>> >> >> > > |
|
||
|
||||
|
Ken Snell
Guest
Posts: n/a
|
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 >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > |
|
||
|
||||
|
Bob Vance
Guest
Posts: n/a
|
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 >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > |
|
||
|
||||
|
Bob Vance
Guest
Posts: n/a
|
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 >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > |
|
||
|
||||
|
|
|
| |
![]() |
| Thread Tools | |
| Rate This Thread | |
|
|
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 |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc. |




