A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Format a text box!



 
 
Thread Tools Display Modes
  #1  
Old April 7th, 2010, 12:41 AM posted to microsoft.public.access.reports
Bob Vance
external usenet poster
 
Posts: 726
Default Format a text box!

[tblInvoice].[ClientDetail] Only appears in the table when there is no
funGetHorse, what i trying to do is get foward slash "/" to appear in front
of tblInvoice.ClientDetail and not show after FunGetHorse and OwnerPercent
As you see below "/" is appearing after OwmerPercent
Pancho @ 100%/ (this is wrong)
Joe Blogs / ClientDetail (This is Correct)




SELECT tblInvoice.OwnerID, tblInvoice.OwnerName, tblInvoice.InvoiceDate AS
OnDate,iif(tblInvoice.ClientInvoice=true,tblInvoic e.OwnerName,funGetHorse(tblInvoice.InvoiceID)
& " @ " & Format(tblInvoice.OwnerPercent,"0.0%"))&("/"&
[tblInvoice].[ClientDetail]) AS Description, tblInvoice.OwnerPercentAmount
AS AmountSummary, tblInvoice.InvoiceID, tblInvoice.InvoiceNo,0 AS Flag
--
Thanks in advance for any help with this......Bob
MS Access 2007 accdb
Windows XP Home Edition Ver 5.1 Service Pack 3


  #2  
Old April 7th, 2010, 04:46 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Format a text box!

Bob Vance wrote:

[tblInvoice].[ClientDetail] Only appears in the table when there is no
funGetHorse, what i trying to do is get foward slash "/" to appear in front
of tblInvoice.ClientDetail and not show after FunGetHorse and OwnerPercent
As you see below "/" is appearing after OwmerPercent
Pancho @ 100%/ (this is wrong)
Joe Blogs / ClientDetail (This is Correct)

SELECT tblInvoice.OwnerID, tblInvoice.OwnerName, tblInvoice.InvoiceDate AS
OnDate,iif(tblInvoice.ClientInvoice=true,tblInvoi ce.OwnerName,
funGetHorse(tblInvoice.InvoiceID)
& " @ " & Format(tblInvoice.OwnerPercent,"0.0%"))&("/"&
[tblInvoice].[ClientDetail]) AS Description, tblInvoice.OwnerPercentAmount
AS AmountSummary, tblInvoice.InvoiceID, tblInvoice.InvoiceNo,0 AS Flag



Can't you just move the & "/" to where you want it inside
the IIf?

--
Marsh
MVP [MS Access]
  #3  
Old April 7th, 2010, 01:39 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default Format a text box!

IF ClientDetail is NULL then you can use this concatenation trick.
"XXX" & Null returns "XXX"
"XXX" + Null returns Null

IIF(tblInvoice.ClientInvoice=true
,tblInvoice.OwnerName
,funGetHorse(tblInvoice.InvoiceID)
& " @ " & Format(tblInvoice.OwnerPercent,"0.0%"))
& ("/" + [tblInvoice].[ClientDetail])

OR more general and not relying on the "concatenation trick" you can use the
following if ClientDetail might be a zero-length string "" or null.

IIF(tblInvoice.ClientInvoice=true
,tblInvoice.OwnerName
,funGetHorse(tblInvoice.InvoiceID)
& " @ " & Format(tblInvoice.OwnerPercent,"0.0%"))
& IIF(Len([ClientDetail & "") = 0,"",("/" & [tblInvoice].[ClientDetail]))


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Bob Vance wrote:
[tblInvoice].[ClientDetail] Only appears in the table when there is no
funGetHorse, what i trying to do is get foward slash "/" to appear in front
of tblInvoice.ClientDetail and not show after FunGetHorse and OwnerPercent
As you see below "/" is appearing after OwmerPercent
Pancho @ 100%/ (this is wrong)
Joe Blogs / ClientDetail (This is Correct)




SELECT tblInvoice.OwnerID, tblInvoice.OwnerName, tblInvoice.InvoiceDate AS
OnDate,iif(tblInvoice.ClientInvoice=true,tblInvoic e.OwnerName,funGetHorse(tblInvoice.InvoiceID)
& " @ " & Format(tblInvoice.OwnerPercent,"0.0%"))&("/"&
[tblInvoice].[ClientDetail]) AS Description, tblInvoice.OwnerPercentAmount
AS AmountSummary, tblInvoice.InvoiceID, tblInvoice.InvoiceNo,0 AS Flag

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.