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.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Input mask, home number, microsoft access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-15-11, 10:04
05peacockh 05peacockh is offline
Registered User
 
Join Date: Sep 2011
Posts: 1
Input mask, home number, microsoft access

COLOR="Magenta"]i do not know the input mask to enter for a home number on microsoft access starting with 0208 330 5199 and 01372 81765 can anyone help me? [/COLOR][/COLOR]
Reply With Quote
  #2 (permalink)  
Old 09-15-11, 10:05
05sullivanj 05sullivanj is offline
Registered User
 
Join Date: Sep 2011
Posts: 1
Input masks codes, home number, microsoft access

Help!!

I don't know how to set the input mask for a home telephone number starting with (0208) 879 0987 as well as (01732) 123456! Please someone help!

Thanks
Reply With Quote
  #3 (permalink)  
Old 09-15-11, 10:05
JAYAONLINE JAYAONLINE is offline
Registered User
 
Join Date: Sep 2011
Posts: 3
Exclamation Input Masks for Microsoft Access 2007

Hi,

HELP ME PLEEAASSEE!

I need some help with telephone number input masks for Microsoft Access 2007

I want it to appear like this:

(0208)644-792
(01732)739476

Thanks
Reply With Quote
  #4 (permalink)  
Old 09-15-11, 13:08
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
threads merged
all 3 come from the same (school) domain
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 09-15-11, 13:19
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
Search for InputMask in Access help.
__________________
Have a nice day!
Reply With Quote
  #6 (permalink)  
Old 09-15-11, 13:37
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
Im not sure its possible to do this using a format mask in Access, however you could do this by formatting using a function in VBA

eg
Code:
private function FormatUKPhoneNumber(PhoneNumber as string) as string
FormatUKPhoneNumber = PhoneNumber 'set up our default return state
'first lets assume the worst and strip out any existing punctuation
PhoneNumber = replace(PhoneNumber," ","") 'strip out any spaces in the supplied data.....
PhoneNumber = replace(PhoneNumber,"(","") 
PhoneNumber = replace(PhoneNumber,")","") 
PhoneNumber = replace(PhoneNumber,"+","")
if not isnumber(PhoneNumber) then 'the supplied number has some other invalid characters
'can't be arsed to find out what it is just pump back what was supplied
else
  'a uk phonenumber has 11 digits
  if length (phonenumber) <>11 then
    'hokay options are 'it can be 10 digits if the leading 0 is supressed
    'all UK numbers start 0x where x is a digit 1..9
    if left(PhoneNumber <> "0") then
      FormatUKPhoneNumber = FormatUKPhoneNumber(PhoneNumber)
    else ' pump back what was supplied
    endif
  endif
  if left(ThisPhoneNumber,2) = "02" then
    FormatUKPhoneNumber = "(" & left(ThisPhoneNumber,3) & ") " & mid(ThisPhoneNumber, 3,4) & " " & right(ThisPhoneNumber,6)
else 'then its a simple number std code (5 digits) + 6 digits
    FormatUKPhoneNumber = "(" & left(ThisPhoneNumber,5) & ") " & right(ThisPhoneNumber,6)
  endif
endif
end function
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Tags
access 2007, input mask, microsoft access

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On