Juan Velasquez
asked on
Problem formatting a string
I am trying to format the following strings using the format function Format( Cstr(Format([ChargeNumber] )),"000000 00\.00\.00 \.00\.000" )
Input String Desired Output Actual Output
18006350037100000 18006350.03.71.00.000 18006350.03.71.00.000
1800565125710032A 18005651.25.71.00.32A 1800565125710032A
As you can see, the first input string is formatted properly, however the second string is not being formatted.
Input String Desired Output Actual Output
18006350037100000 18006350.03.71.00.000 18006350.03.71.00.000
1800565125710032A 18005651.25.71.00.32A 1800565125710032A
As you can see, the first input string is formatted properly, however the second string is not being formatted.
because it is not numeric...
try
"00000000\.00\.00\.00\.00# "
or
"00000000\.00\.00\.00\.00_ "
trying to remember
"00000000\.00\.00\.00\.00#
or
"00000000\.00\.00\.00\.00_
trying to remember
you can use something like this (not tested)
Mid(ChargeNumber,1,8) & "." &
Mid(ChargeNumber,9,2) & "." &
Mid(ChargeNumber,11,2) & "." &
Mid(ChargeNumber,13,3)
Mid(ChargeNumber,1,8) & "." &
Mid(ChargeNumber,9,2) & "." &
Mid(ChargeNumber,11,2) & "." &
Mid(ChargeNumber,13,3)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ah yes the @ good catch HainKurt
ASKER
Thanks. That's what I was looking for. I had checked help in Access 97 but I saw no mention of using @.
for more info on formatting strings, refer to
http://office.microsoft.com/en-us/access-help/format-property-text-and-memo-data-types-HA001232747.aspx?CTT=5&origin=HA001228839
http://office.microsoft.com/en-us/access-help/format-property-text-and-memo-data-types-HA001232747.aspx?CTT=5&origin=HA001228839