Solved

Format text box with PO BOX

Posted on 2008-10-16
11
962 Views
Last Modified: 2012-05-05
Sorry, I'm a newbie and not a programmer, just a great hacker. I am working on an address field in access 2003. The issue is this field is mixxed with street addresses and post office boxes. We want to standardize formatting of "PO BOX" in this field if possible. It is a practice if a PO BOX is used it is always first not the street adress. So, can "PO BOX" be a mask? Additionaly this field is currently set in AfterUpdate to StrConv(string, vbProperCase)
0
Comment
Question by:purelink
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
11 Comments
 
LVL 26

Expert Comment

by:dannywareham
ID: 22736224
Is there an actual format for PO Box?
For example, are they always just "PO Box 123", like I think?
In which case, why not just store the number part?

If teh text part is always the same, you can set it to an inputmask on the text box.
Is that what you need?
0
 

Author Comment

by:purelink
ID: 22752836
The format wold be for "PO BOX" to be in uppercase I actually had the colum set wit StrCase("string",vbUppercasae) but we have letters that pull from the data base and it became an issue for some of the managemnt how it looked So then i used StrCase("string", vbPropercase) but that made it this way; "Po Box" not bad but you see what I am chasing?
Thank you for any help yo may have!
0
 
LVL 26

Expert Comment

by:dannywareham
ID: 22752900
OK.
Have an input mask on the control field like this:

LL9LLL09999

Then have code on teh after_update of the text vox:

me.textboxname.value = UCase(me.textboxname.value)

try that
:-)
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:purelink
ID: 22759188
OK, My limited knowledge has hung me. I easily added the input mask field as suggested, however, I am having a problem witht the additional code.  beside after update field I am choosing code builder, then Macro builder but that's where im stuck I am just doing trial and error to test.  I will follow up after I get this.
0
 

Author Comment

by:purelink
ID: 22759571
dannywareham,
Thank you for your help, I think i may have steered you a bit wrong though after looking at the input mask. This field is called Address1 and it contains both a traditional address; 123 Main Street or PO BOX 1234. It is our company policy that if the address has a PO# it will always be first in the address field, and typically, we then will use Address2  field for the traditional address; 123 Main Street.
Thank you!
 
0
 
LVL 26

Accepted Solution

by:
dannywareham earned 500 total points
ID: 22759743
Oh, right.
So you need code that says "if it starts with PO Box, change to capitals, otherwise leave it as its an address"?

Something like:
If left(me.txtBoxName,5) = "PO Box" Then
  StrConv(me.txtBoxname, vbUppercase) 
Else
  StrConv(me.txtBoxname, vbProperCase) 
End if

Open in new window

0
 

Author Comment

by:purelink
ID: 22759997
Yes, that's right.  
0
 
LVL 26

Expert Comment

by:dannywareham
ID: 22760045
Use the code I posted in the After_Update() event.
0
 

Author Comment

by:purelink
ID: 22760465
OK I will try that
0
 

Author Comment

by:purelink
ID: 22867996
FYI,
I have been away, I will be back on this project shortley.
Thank you for the support !
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access vs Access runtime 6 58
MS Access query 16 53
GA Ribbon creator 9 53
Error message for incorrect or missing hyperlink 3 19
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question