Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2005

Tip: Looking for answers? Try searching our database.

stopping a hyphen

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Angi - 02 May 2005 01:59 GMT
I'm using the following to populate my text box.  If the acctbal is a
negative number, it wraps it.  How can I stop this from happening and
keep the - with the number?

Code:
Forms!deprec2!txtInfo = "This invoice is paid, but there are " &
InvCount & " outstanding invoices on this account with a balance of " &
Format(AcctBal, "$#,##0.00;$-#,##0.00") & ". The payment is more than
is owed on the account. You will need to issue a credit if you accept
this payment."

TIA!
Al Camp - 02 May 2005 02:47 GMT
Angi,
  Expirement with a wider or narrower text control.  That should cause the
"wrap" to occur before or after the number.

hth
Al Camp

> I'm using the following to populate my text box.  If the acctbal is a
> negative number, it wraps it.  How can I stop this from happening and
[quoted text clipped - 8 lines]
>
> TIA!
Arvin Meyer - 02 May 2005 02:52 GMT
Write your own little function like (aircode):

Public Function MyFormat(varIn As Variant) As String
On Error Resume Next ' use better error handling

If IsNumeric(varIn) Then
   MyFormat = Format(varIn, "$#,##0.00")
Else
   MyFormat = ""
End If

End Function

Substitute your function:

Forms!deprec2!txtInfo = "This invoice is paid, but there are " &
InvCount & " outstanding invoices on this account with a balance of " &
MyFormat(AcctBal) & ". The payment is more than
is owed on the account. You will need to issue a credit if you accept
this payment."
Signature

Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

> I'm using the following to populate my text box.  If the acctbal is a
> negative number, it wraps it.  How can I stop this from happening and
[quoted text clipped - 8 lines]
>
> TIA!
Angi - 02 May 2005 03:46 GMT
Thanks for the replies!  I don't want to change the size of the text
box, so I tried the function idea.  That, unfortunately, didn't work
either.  It's still putting the - on the previous line and then the
$1600.00.  Any other ideas??  I thought about putting a hard return in,
but with smaller amts, I think it will look stupid.  Isn't there a
bracket or some other syntax thays "keeps this together as a group"?
John Vinson - 02 May 2005 05:05 GMT
>Thanks for the replies!  I don't want to change the size of the text
>box, so I tried the function idea.  That, unfortunately, didn't work
>either.  It's still putting the - on the previous line and then the
>$1600.00.  Any other ideas??  I thought about putting a hard return in,
>but with smaller amts, I think it will look stupid.  Isn't there a
>bracket or some other syntax thays "keeps this together as a group"?

Might it help to put a blank before the - sign?

                 John W. Vinson[MVP]    
Angi - 02 May 2005 05:38 GMT
Thanks for the reply, John.  I just added a return.  It looks alright,
so that'll have to do for now.  Thanks for all the suggestions!!!  It
helps to have more than head...especially when mine is fried!

Have a good one!
Al Camp - 02 May 2005 15:39 GMT
Angi,
  Try rephrasing your concatenation slightly to force that wrap to occur in
a different place...
You wrote
>" outstanding invoices on this account with a balance of "
Try
" outstanding invoices against this account with a balance of "
That might force the whole -number onto the next line.
hth
Al Camp

> Thanks for the reply, John.  I just added a return.  It looks alright,
> so that'll have to do for now.  Thanks for all the suggestions!!!  It
> helps to have more than head...especially when mine is fried!
>
> Have a good one!
John Nurick - 02 May 2005 22:15 GMT
Hi Angi,

Just a thought: what happens if you use the Unicode minus sign (U+2212)
in the format string instead of the hyphen?

 ...Format(AcctBal, "$#,##0.00;$" & ChrW(&H2212) & "#,##0.00")

>Thanks for the reply, John.  I just added a return.  It looks alright,
>so that'll have to do for now.  Thanks for all the suggestions!!!  It
>helps to have more than head...especially when mine is fried!
>
>Have a good one!

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Angi - 03 May 2005 01:51 GMT
John,
That worked!  Thank you so very much!!!

BR,
Angi
John Nurick - 03 May 2005 06:47 GMT
I'm glad. Now I need to remember this for next time someone needs it!

>John,
>That worked!  Thank you so very much!!!
>
>BR,
>Angi

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.