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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Validation rule
I would like a field in my table to have 5 characters. If
the entry have less than 5, a Zero adds to the front of data. If enter 345D. It should correct to 0345D. If entry more than 5 characters, validate text pop-up. Could someone help me with the "Zero adds to the front of data"? Thanks Ashley |
#2
|
|||
|
|||
Validation rule
Well, if you're adding it through a macro, here is some sample code (should
work :-)) Dim A as string, B as string A = "345D" B = String("0", 5 - Len(A)) + A B now contains the string you need :-) If it doesn't work...look up how to use the String function. Sincerely, ASP.Confused "Ashley" wrote in message ... I would like a field in my table to have 5 characters. If the entry have less than 5, a Zero adds to the front of data. If enter 345D. It should correct to 0345D. If entry more than 5 characters, validate text pop-up. Could someone help me with the "Zero adds to the front of data"? Thanks Ashley |
#3
|
|||
|
|||
Validation rule
Stupid me....just realized what a "Validation Rule" is...lol. What I gave
you might help you out, but I'm stuck on this question too. "ASP.Confused" anonymous@ wrote in message ... Well, if you're adding it through a macro, here is some sample code (should work :-)) Dim A as string, B as string A = "345D" B = String("0", 5 - Len(A)) + A B now contains the string you need :-) If it doesn't work...look up how to use the String function. Sincerely, ASP.Confused "Ashley" wrote in message ... I would like a field in my table to have 5 characters. If the entry have less than 5, a Zero adds to the front of data. If enter 345D. It should correct to 0345D. If entry more than 5 characters, validate text pop-up. Could someone help me with the "Zero adds to the front of data"? Thanks Ashley |
#4
|
|||
|
|||
Validation rule
try something like:
Me![MyField] = Right("00000" & [input],5) I'm not certain of the placement of the quotes but it should be similar to that. Me![MyField] is where you want to store it [input] is what the user typed in HTH -----Original Message----- Stupid me....just realized what a "Validation Rule" is...lol. What I gave you might help you out, but I'm stuck on this question too. "ASP.Confused" anonymous@ wrote in message ... Well, if you're adding it through a macro, here is some sample code (should work :-)) Dim A as string, B as string A = "345D" B = String("0", 5 - Len(A)) + A B now contains the string you need :-) If it doesn't work...look up how to use the String function. Sincerely, ASP.Confused "Ashley" wrote in message ... I would like a field in my table to have 5 characters. If the entry have less than 5, a Zero adds to the front of data. If enter 345D. It should correct to 0345D. If entry more than 5 characters, validate text pop-up. Could someone help me with the "Zero adds to the front of data"? Thanks Ashley . |
#5
|
|||
|
|||
Validation rule
Ashley
Why? Are you more concerned about how it looks, or what character string is stored? You can set the display format to zero-pad, without altering the stored string. -- Good luck Jeff Boyce Access MVP |
#6
|
|||
|
|||
Validation rule
Expanding on Ernie's method, here is this:
Me![MyField] = String$(5 - Len([input], "0") + [input] "Ernie" wrote in message ... try something like: Me![MyField] = Right("00000" & [input],5) I'm not certain of the placement of the quotes but it should be similar to that. Me![MyField] is where you want to store it [input] is what the user typed in HTH -----Original Message----- Stupid me....just realized what a "Validation Rule" is...lol. What I gave you might help you out, but I'm stuck on this question too. "ASP.Confused" anonymous@ wrote in message ... Well, if you're adding it through a macro, here is some sample code (should work :-)) Dim A as string, B as string A = "345D" B = String("0", 5 - Len(A)) + A B now contains the string you need :-) If it doesn't work...look up how to use the String function. Sincerely, ASP.Confused "Ashley" wrote in message ... I would like a field in my table to have 5 characters. If the entry have less than 5, a Zero adds to the front of data. If enter 345D. It should correct to 0345D. If entry more than 5 characters, validate text pop-up. Could someone help me with the "Zero adds to the front of data"? Thanks Ashley . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Validation Rule | Shark | General Discussion | 2 | July 28th, 2004 04:39 PM |
Validation Rule question | Lori | Using Forms | 1 | July 20th, 2004 06:32 PM |
HELP!!! Validation rule | Chris | Using Forms | 7 | June 1st, 2004 01:11 PM |
Validation Rule | Tom | Database Design | 3 | May 18th, 2004 10:27 PM |
Format cell using Validation rule | DDM | Worksheet Functions | 5 | May 3rd, 2004 10:17 PM |