WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Input Mask query

 
   Home -> Office other -> General Discussions RSS
Next:  Compact and Repair Problem  
Author Message
Raymond

External


Since: Jun 08, 2006
Posts: 51



(Msg. 1) Posted: Thu Jul 03, 2008 5:16 pm
Post subject: Input Mask query
Archived from groups: microsoft>public>access (more info?)

Hi all,

I have a textbox for telephone and fax nos. for which i added the input mask
as telephone no. (999)-(999)-(9999) (the default no., that is...) The
requirement is that if a no., say, +86-23-4455 has to be added, the format
does not alllow it and writes the no. as +86-234-455. Also, it should not
become +86-023-4455 as this becomes a different telephone no...

How do I correct this problem...As far as i undrstnd, i'll go for a do while
loop on the mask and when the appropriate condition arises, i can put the
codes..but i am unable to do that..>>> Your help will be acknowledged....
Back to top
Login to vote
strive4peace

External


Since: Apr 04, 2006
Posts: 946



(Msg. 2) Posted: Thu Jul 03, 2008 9:17 pm
Post subject: Re: Input Mask query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Raymond,

the InputMask,as I understand it, is applied when you enter or change
the data ...

that said, you can

1. remove the mask
2. enter data

how do you do this?

make an unbound textbox to enter a phone number with any symbols

on the AfterUpdate event, remove the mask from the phone textbox (make
sure it is defined in the form, not at the table level), place the data
in, save the record, then put the mask back


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day Smile
*




Raymond wrote:
> Hi all,
>
> I have a textbox for telephone and fax nos. for which i added the input mask
> as telephone no. (999)-(999)-(9999) (the default no., that is...) The
> requirement is that if a no., say, +86-23-4455 has to be added, the format
> does not alllow it and writes the no. as +86-234-455. Also, it should not
> become +86-023-4455 as this becomes a different telephone no...
>
> How do I correct this problem...As far as i undrstnd, i'll go for a do while
> loop on the mask and when the appropriate condition arises, i can put the
> codes..but i am unable to do that..>>> Your help will be acknowledged....
Back to top
Login to vote
Raymond

External


Since: Jun 08, 2006
Posts: 51



(Msg. 3) Posted: Thu Jul 03, 2008 9:17 pm
Post subject: Re: Input Mask query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hey, i didn;t understand how we can accept the record from the user after
disabling the mask..what's the command??/

me.phonetextbox.inputmask=false
????????????????????????? What comes here???????????
me.phonetextbox.inputmask=true
Back to top
Login to vote
strive4peace

External


Since: Apr 04, 2006
Posts: 946



(Msg. 4) Posted: Thu Jul 03, 2008 11:49 pm
Post subject: Re: Input Mask query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Raymond,

you would do something like this in the AfterUpdate event of the UNBOUND
textbox to create a phone number:

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Error GoTo Proc_Err

Dim mPhone As String

If Len(Trim(nz(controlname_UnboundPhone,""))) = 0 Then
GoTo Proc_Exit
End If

Me.Phone.InputMask = ""

Me.Phone = controlname_UnboundPhone

' clear unbound phone control
Me.controlname_UnboundPhone = null

'save the record
me.dirty = false

Me.Phone.InputMask = "!\(999"") ""000\-0000;0;_"

Proc_Exit:
Me.Phone.SetFocus
Exit Sub

Proc_Err:
MsgBox Err.Description, , _
"ERROR " & Err.Number _
& " PhonePaste"
Resume Proc_Exit

'if you want to single-step code to find error, CTRL-Break at MsgBox
'then set this to be the next statement
Resume
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

WHERE
controlname_UnboundPhone is the control NAME of your unbound phone number
Phone is the control NAME of your phone number

theoretically this should work ...

~~~~~~~~~~~
for better understanding of the basics of Access, read this:

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

Warm Regards,
Crystal

remote programming and training



*
(: have an awesome day Smile
*




Raymond wrote:
> Hey, i didn;t understand how we can accept the record from the user after
> disabling the mask..what's the command??/
>
> me.phonetextbox.inputmask=false
> ????????????????????????? What comes here???????????
> me.phonetextbox.inputmask=true
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET