How to add leading zeros to split field string

How do I add leading zeros to this? 

BLDG: Mid([LOCATION],InStr([LOCATION],"-")+1)

Please help.
0
Utf
4/8/2010 7:16:17 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
1277 Views

Similar Articles

[PageSpeed] 8

CS wrote:

>How do I add leading zeros to this? 
>
>BLDG: Mid([LOCATION],InStr([LOCATION],"-")+1)
>

How many zeros?  If its alway the same number:
	BLDG: String(howmany, "0") & Mid(LOCATION, InStr(LOCATION,
"-") + 1)

If you want to pad it out so the result is a specific
length:

	BLDG: Right(String(99, "0") & Mid(LOCATION,
InStr(LOCATION, "-") + 1), specificlength)

-- 
Marsh
MVP [MS Access]
0
Marshall
4/8/2010 7:49:19 PM
My response yesterday --
  Left([YourField], InStr([YourField], "-")-1) & Right("00000" & 
Mid([YourField], InStr([YourField], "-")+1, 5)

-- 
Build a little, test a little.


"CS" wrote:

> How do I add leading zeros to this? 
> 
> BLDG: Mid([LOCATION],InStr([LOCATION],"-")+1)
> 
> Please help.
0
Utf
4/9/2010 3:34:02 PM
Reply:

Similar Artilces:

Add Lookup Fields to Entity
I need to add 4 "technical contact" fields (which would lookup the Contact entity) to the CONTRACT form. Is this possible? I've found it difficult to figure out what to do first. Thanks in advance, Brandon Not possible. You cant have multiple lookups for the same entity. You also cannot create new relationships between two system entitites. This will work in 4.0 Not possible, Pezman. N:M relationships are not possible in 3.0 yet. There is a alternative solution: a new entity to act as an N:M relationship. In your case, Contract/Contact. This entity has two 1:N relations...

can I get cells with a minus number to show zero
I have a cell which has a basic formula in (adding up from 2 other cells) This number can end up being a minus number (-167), If this happens I need to be able to make that minus number appear as a zero (0). Is this possible? please help. =IF(A1+B1<0,0,A1+B1) Alternative =MAX(0,A1+B1) Gord Dibben Excel MVP On Sat, 7 May 2005 08:28:03 -0700, "marcus1066" <marcus1066@discussions.microsoft.com> wrote: >I have a cell which has a basic formula in (adding up from 2 other cells) >This number can end up being a minus number (-167), If this happens I need to >be...

Excel Add Ins
What is the name of the template wizard with Data Tracking (Excel. I can not locate the add in template wizard with Data Tracking in Office 2003 Hi Richard You are not the only one<g> The Add-in is working in 2003 only the install file is not working. Copy the xla file from a PC with 2002 to the PC with 2003 and it will work(use Tools>add-ins to browse to the file in Excel) -- Regards Ron de Bruin http://www.rondebruin.nl "Richard" <Richard@discussions.microsoft.com> wrote in message news:193C5DFD-578D-48F7-B9D6-9FEF5BDCEB64@microsoft.com... > What is t...

Add on
Hello, Here is a scenerio. A client is buying 1lb of ham. It is put on a waxed paper then wrapped into a white paper and then put into a shopping bag. The usage of shopping bag is 100% cases the usage of paper is only with certin categories of sales. Same with the waxed paper. Question: Is there a way of associating wax paper, white paper and shopping bags in a way so with every sale a piece of paper gets deducted from inventory and one bag is deducted from inventory? I would like to run a report every so often and see if I need to purchase any supplies. Kits and assembly do not work...

add a row or column to a single cell in exel
I am trying to split a single cell into 2 rows can you help If I understood correctly you want to enter an entry in two lines in a cell at appropirate place hit lt+enter and again hit enter for e.g venkat (alt+enter) raman(enter) "trev" <trev@discussions.microsoft.com> wrote in message news:89B2C15C-057F-43B9-8282-37923D5EA397@microsoft.com... > I am trying to split a single cell into 2 rows can you help ...

way to delete add. fr. auto. email add. function?
Is there a way to delete old or no longer used email addresses that appear in the drop down box when I am addressing a new email? Shebubba wrote: > Is there a way to delete old or no longer used email addresses that appear in > the drop down box when I am addressing a new email? That is the nickname cache. Search and delete the .nk2 file. That's the cache for nicknames (i.e., your manually entered e-mail addresses). If you only want to delete some of them, highlight an entry and hit the delete key. If that doesn't work, use Nirsoft's NK2 Viewer utility (it e...

POS 2009 Add-In: Populating a Task Pad
I would like to create a custom application that has the ability to maintain the items that are on certain Task Pads within POS 2009. These items would all be regular menu items (ex: hamburger, hot dog, french fries, etc) and not functions. For example, if a task pad was supposed to allow the cashier quick access to daily specials, then this custom application would need to be able to clear the task pad each day and add the items for that day. Is this going to be possible? Please provide some guidance. Thank you, Sean This is a multi-part message in MIME format. ------=_NextPart_00...

Add-in cannot be loaded OL07
Every time I open Outlook 2007 I get an error message regarding an add-in 'DCCExtensions' (DCCEXT32.DLL). It says the add-in cannot be loaded and has been disabled by Outlook. I've been getting this message ever since I uninstalled Winfax. How do I make this error stop appearing? Thanks. -- kapibarra Remove the addin from OL by using Trust Center, Addins. http://office.microsoft.com/en-us/outlook/HA100341271033.aspx#14 "kapibarra" wrote: > Every time I open Outlook 2007 I get an error > message regarding an add-in 'DCCExtensions' (DCCEXT32.DLL). ...

Format text to add character
I have two fields that should match, but one includes special characters while the other does not. Example: Field1 00ABCD123456123 Filed2 00/ABCD/123456/123/SBZ I need to find records where these two fields don't match, either by changing the display of one of them, or a query to compare Field1 character 7-15 with Field2 characters 9-14, 16-18. Hope this makes sense. Can anyone help? Thanks! Take a look at the following from the Access Help file it might be what you're looking for... Extract a part of a text value The following table lists examples of expressions that ...

How to zero a messy inventory
My client wants to zero out their inventory because it's mostly junk data. They want to keep the items. They have a bunch of old sales orders which some of this inventory is allocated to. They also have SOP to POP links on some of these old sales orders. As I understand, to clean it up they must delete 1) POP links 2) delete SO's , and 3) zero the inventory. I see no need to delete the old PO's... Is my understanding right ? Is there any easier way to do it besides one at a time ? Thanks very much. Joe, try the following to zero out inventory quantities. "Jo...

Add File menu to custom toolbar
Hi All, I am trying to add the 'File" menu and "Window" menu of the Standard Toolbar to a custom toolbar but failing miserably! I think it should look something like: Sub AddMenuTitles() Application.CommandBars("MyCustomMenu").Controls.Add("File) Application.CommandBars("MyCustomMenu").Controls.Add("Window") End Sub Can anybody help please Regards Michael Sub test() AddMenuTitles True ' or false to delete End Sub Sub AddMenuTitles(bAdd As Boolean) Dim cbr As CommandBar Dim cbP As CommandBarPopup ...

Why does Publisher insert a leading space when pasting text?
When I paste text from MS Word into MS Publisher a space is inserted at the beginning of each paragraph. How can I prevent this? Paste special as unformatted text. Or with your cursor in the text box, select all, format, paragraph, set before paragraph 0pt. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx "Saints RFC fan" <SaintsRFCfan@discussions.microsoft.com> wrote in message news:2E41BD3C-057D-4275-9832-8EE6AAA80243@microsoft.com... > When I past...

Use Parameter Data to populate a form field
I am trying to figure out how to take the data I enter from a parameter query to populate a field on a form. Include the parameter(s) as a computed column(s) in the query, e.g. PARAMETERS [Enter start date:] DATETIME, [Enter end date:] DATETIME; SELECT SomeField, SomeOtherField, [Enter start date:] AS StartDate, [Enter end date:] AS EndDate FROM SomeTable WHERE DateField BETWEEN [Enter start date:] AND [Enter end date:]; In the above example you can then bind text box controls on the form to the StartDate and EndDate fields. Ken Sheridan Stafford, England JudyKemp w...

add a DC in a LegSite
Hi, In the disaster recovery plan we want to create a leg site and put a DC in it. Here are some questions on how to achieve this smoothly. 1. Should I create the new site/subnet first and then promote a server in that subnet/site to DC, or should I promote a server in existing site/subnet and then move this DC to the new site/subnet? 2. When promoting a server to DC, should the server be a member server (already joined the domain) or just a workgroup member (no domain membership)? 3. The DC will be an AD-integrated DNS server. Should I install the DNS component (but not confi...

How can I add the customer's PO# to the drop-ship Purchase Order?
Our purchasing agent would like to be able to have the customers PO# from the Sales Transaction Entry screen show up on the PO's. Is this doable in Report Writer or can it not be done? We are using GP v9.0. As I still consider myself a newbie with RW, I would appreciate detailed instructions if possible. Thank you in advance for all responses. It is not possible thru traditional table relationships in Report Writer. Let me explain: you can certainly link the Purchase Order Work table to the SOP_POLink table and the SOP_POLink table to the SOP Transactions Work table, but will...

excel add-ons
Awhile back, there was an add-on for excel that had a lot more tools. It showed on the toolbar. Somehow I lost it and I would like to get it back. It had a lot of tools like for changing case and fill ins. Any help wouyld be great. Maybe ASAP Utilities. Try a 'net search for this add-in. Gord Dibben MS Excel MVP On Sun, 22 Mar 2009 20:22:43 -0400, "kmkx70a" <kmkx70a@prodigy.net> wrote: >Awhile back, there was an add-on for excel that had a lot more tools. It >showed on the toolbar. Somehow I lost it and I would like to get it back. It >had a lot of t...

Having OL automatically add a bcc: address
My boss wants to add me as a bcc: to every email she sends. Is there a way to set this up to happen automatically? Please reply to matt@lkigroup.com Thanks much. Matt ...

Macro to change pivot field with latest value 03-01-10
This is a re-post as my questions hasn't been answered by anyone... Hi there and thank you in advance for any help. I have written a macro that changes (hides / shows) fields on a pivot table. One of these changes the field used for the page fields section of the pivot table. However, when i add a field to this section, it defaults to All. How can have this field default to the latest value in this field. Let me explain further: I want the pivot to be shown either by date or by week. The macro then changes the page field section to show either the date or week field. If ...

Map Add-On?
I am looking for an Excel Chart add on so that I can take numerical data and display it on a geographic map of states or zip codes for example. Even better I could color or shade a state based on the values in my spreadsheet. Any suggestions would be appreciated. Mark ...

How to add a VScroll to a CStatic Object
I create a CStatic object and write some text to the object but the text is too long to display in the work area but I don't konw how to add a vscroll to a CStatic object who can help me? I would say instead of a CStatic, use a CEdit control with the ReadOnly flag set. Because static controls by default aren't scrollable, so even if you add a scrollbar to it, you will have to manage the entire thing yourself (drawing, scrolling....), more trouble than it's worth. Ali R. "Smallfrogs" <super_smallfrogs@hotmail.com> wrote in message news:eLAO92y7DHA.2832@tk2msft...

Force leading zeros
We have an excel spreadsheet which we use to import data into a database. We have one column (PID) which needs to be validated before loading the remaining data for the row into the database. The user copies the data from another source and pastes it into the spreadsheet. The PID column needs to be 12 digits and have leading zeros if the length is less than 12 digits. We can set the cell format to show the leading zero but when the spreadsheet is imported, the leading zeros are not present in the raw data. The only option we have come up with so far it to create a second column which ha...

Copy Pivot calculated field to another pivot
Hi all, I am not very familiar with pivot tables in excel. but I have to re-create a pivot table report by selecting the data from a database. I wanted to know if it is possible to copy over the calculated fields from the existing pivot report to the new one. There are a lot of formulas and quite a few pivot report that need to be re-created. the field names are same. Any suggestions will be greatlly appreciated. Thanks, HD ...

Add ContractLine Entity in Menu
Hi, Is it possible to add a shortcut in the Service Menu to the ContractLine Entity? I really appreciate if someone could help. Regards, Alcides ...

Problem- add-in Access Outlook Add-in for Data Collection & Publis
I have a problem with Outlook 2007 and the add-in Access Outlook Add-in for Data Collection and Publishing. This add-in worked when I first installed Outlook 2007 when installing Office 2007 Enterprise. The add-in created a sub-folder in my Inbox named Data Collection Replies and worked well until about 6 weeks ago. Now I can’t get the add-in to work at all even though it appears in the list of COM.adds in Outlook 2007. More perplexing is the error message I now receive EVERY time I click on any email message to read it. The message is titled ‘Custom UI Runtime Error in...

QUICKSELL Blank or Empty Fields/data
How should I treat an empty excel field on import with Quicksell? Example "Notes" <I don’t' have any data for this field>. Do I leave the field blank, or place a comma in the field, or put some text, or delete the column and don't include the field in the import? How should I treat "Last Sold" field if I do not have a history? Similar to above do I leave the field blank, or place a comma in the field, or put some text, or delete the column and don't include the field in the import? When I have a item unlike others with data what should I do if I ...