Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: Alternate input masks on a form

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Alternate input masks on a form
Robin Chapple <robinski[ at ]westnet.com.au> 09.09.2006 20:21:34

I have a membership database with one [PhoneBH] as one of the fields.
I have an input mask to ensure uniformity of presentation when
printed.

Recently members are using a mobile phone as their business contact
number. I would like to present an option button:

" Business number is a mobile "

which changes the default mask.

Default mask is:

00\ 0000\ 0000;0

and mobile mask is:

0000\ 000\ 000;0

Is this possible?

Thanks,

Robin Chapple


Re: Alternate input masks on a form
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 09.09.2006 21:24:54
You can dynamically alter the InputMask property.

Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"

or

Me!MyTextBox.InputMask = "0000\ 000\ 000;0"

in the AfterUpdate property of your option button.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Robin Chapple" <robinski[ at ]westnet.com.au> wrote in message
news:7086g2hq7pdinf77k9lgp5h1cjjo2ggh54[ at ]4ax.com...
[Quoted Text]
>
> I have a membership database with one [PhoneBH] as one of the fields.
> I have an input mask to ensure uniformity of presentation when
> printed.
>
> Recently members are using a mobile phone as their business contact
> number. I would like to present an option button:
>
> " Business number is a mobile "
>
> which changes the default mask.
>
> Default mask is:
>
> 00\ 0000\ 0000;0
>
> and mobile mask is:
>
> 0000\ 000\ 000;0
>
> Is this possible?
>
> Thanks,
>
> Robin Chapple
>
>


Re: Alternate input masks on a form
Robin Chapple <robinski[ at ]westnet.com.au> 10.09.2006 00:27:27

Thanks Doug,

Error message says:

"Not supported"

Robin

On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
<NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:

[Quoted Text]
>You can dynamically alter the InputMask property.
>
>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>
>or
>
>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>
>in the AfterUpdate property of your option button.

Re: Alternate input masks on a form
Robin Chapple <robinski[ at ]westnet.com.au> 10.09.2006 00:47:03

In case it is important the full message is:

"Runtime error:

Object does not support this property or method ""

Robin

On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
<robinski[ at ]westnet.com.au> wrote:

[Quoted Text]
>
>Thanks Doug,
>
>Error message says:
>
>"Not supported"
>
>Robin
>
>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>
>>You can dynamically alter the InputMask property.
>>
>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>
>>or
>>
>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>
>>in the AfterUpdate property of your option button.

Re: Alternate input masks on a form
"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> 10.09.2006 01:19:40
It should support it. Can you post the code that (attempts to) changes
the mask property?

John


Robin Chapple wrote:

[Quoted Text]
> In case it is important the full message is:
>
> "Runtime error:
>
> Object does not support this property or method ""
>
> Robin
>
> On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
> <robinski[ at ]westnet.com.au> wrote:
>
>
>>Thanks Doug,
>>
>>Error message says:
>>
>>"Not supported"
>>
>>Robin
>>
>>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
>><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>>
>>
>>>You can dynamically alter the InputMask property.
>>>
>>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>>
>>>or
>>>
>>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>>
>>>in the AfterUpdate property of your option button.
>
>

Re: Alternate input masks on a form
Robin Chapple <robinski[ at ]westnet.com.au> 13.09.2006 00:07:14
Thanks John,

Private Sub Form_Current()

Me.LastName.SetFocus

If Me.NewRecord Then
Me!fMobileBHSub.Form![MobileBH].Visible = True
ElseIf Len([PhoneBH] & "") = 0 Then
Me!fMobileBHSub.Form![MobileBH].Visible = True
Else
Me!fMobileBHSub.SetFocus
Me!fMobileBHSub.Form![MemberID].SetFocus
Me!fMobileBHSub.Form![MobileBH].Visible = False
End If

If Not IsNull(Me!fMobileBHSub.Form![MobileBH]) Then
Me.[PhoneBH].Visible = False
End If

End Sub

Cheers,

Robin


On Sat, 09 Sep 2006 21:19:40 -0400, "J. Goddard"
<jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:

[Quoted Text]
>It should support it. Can you post the code that (attempts to) changes
>the mask property?
>
>John
>
>
>Robin Chapple wrote:
>
>> In case it is important the full message is:
>>
>> "Runtime error:
>>
>> Object does not support this property or method ""
>>
>> Robin
>>
>> On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
>> <robinski[ at ]westnet.com.au> wrote:
>>
>>
>>>Thanks Doug,
>>>
>>>Error message says:
>>>
>>>"Not supported"
>>>
>>>Robin
>>>
>>>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
>>><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>>>
>>>
>>>>You can dynamically alter the InputMask property.
>>>>
>>>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>>>
>>>>or
>>>>
>>>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>>>
>>>>in the AfterUpdate property of your option button.
>>
>>

Re: Alternate input masks on a form
"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> 13.09.2006 00:56:49
Um, I don't see anything in that code that changes an input mask - am I
missing something?

Are you able to determine which line is causing the error?

John


Robin Chapple wrote:

[Quoted Text]
> Thanks John,
>
> Private Sub Form_Current()
>
> Me.LastName.SetFocus
>
> If Me.NewRecord Then
> Me!fMobileBHSub.Form![MobileBH].Visible = True
> ElseIf Len([PhoneBH] & "") = 0 Then
> Me!fMobileBHSub.Form![MobileBH].Visible = True
> Else
> Me!fMobileBHSub.SetFocus
> Me!fMobileBHSub.Form![MemberID].SetFocus
> Me!fMobileBHSub.Form![MobileBH].Visible = False
> End If
>
> If Not IsNull(Me!fMobileBHSub.Form![MobileBH]) Then
> Me.[PhoneBH].Visible = False
> End If
>
> End Sub
>
> Cheers,
>
> Robin
>
>
> On Sat, 09 Sep 2006 21:19:40 -0400, "J. Goddard"
> <jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>
>
>>It should support it. Can you post the code that (attempts to) changes
>>the mask property?
>>
>>John
>>
>>
>>Robin Chapple wrote:
>>
>>
>>>In case it is important the full message is:
>>>
>>>"Runtime error:
>>>
>>>Object does not support this property or method ""
>>>
>>>Robin
>>>
>>>On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
>>><robinski[ at ]westnet.com.au> wrote:
>>>
>>>
>>>
>>>>Thanks Doug,
>>>>
>>>>Error message says:
>>>>
>>>>"Not supported"
>>>>
>>>>Robin
>>>>
>>>>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
>>>><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>>>>
>>>>
>>>>
>>>>>You can dynamically alter the InputMask property.
>>>>>
>>>>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>>>>
>>>>>or
>>>>>
>>>>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>>>>
>>>>>in the AfterUpdate property of your option button.
>>>
>>>
>

Re: Alternate input masks on a form
Robin Chapple <robinski[ at ]westnet.com.au> 13.09.2006 07:29:08
John,

I was missing putting my brain into gear. My apology.

Here is the code behind the option button:

Private Sub BHMobile_AfterUpdate()

Me!PhoneBH.InputMask = "0000\ 000\ 000;0"

End Sub

Thanks,

Robin


On Tue, 12 Sep 2006 20:56:49 -0400, "J. Goddard"
<jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:

[Quoted Text]
>Um, I don't see anything in that code that changes an input mask - am I
>missing something?
>
>Are you able to determine which line is causing the error?
>
>John
>
>
>Robin Chapple wrote:
>
>> Thanks John,
>>
>> Private Sub Form_Current()
>>
>> Me.LastName.SetFocus
>>
>> If Me.NewRecord Then
>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>> ElseIf Len([PhoneBH] & "") = 0 Then
>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>> Else
>> Me!fMobileBHSub.SetFocus
>> Me!fMobileBHSub.Form![MemberID].SetFocus
>> Me!fMobileBHSub.Form![MobileBH].Visible = False
>> End If
>>
>> If Not IsNull(Me!fMobileBHSub.Form![MobileBH]) Then
>> Me.[PhoneBH].Visible = False
>> End If
>>
>> End Sub
>>
>> Cheers,
>>
>> Robin
>>
>>
>> On Sat, 09 Sep 2006 21:19:40 -0400, "J. Goddard"
>> <jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>
>>
>>>It should support it. Can you post the code that (attempts to) changes
>>>the mask property?
>>>
>>>John
>>>
>>>
>>>Robin Chapple wrote:
>>>
>>>
>>>>In case it is important the full message is:
>>>>
>>>>"Runtime error:
>>>>
>>>>Object does not support this property or method ""
>>>>
>>>>Robin
>>>>
>>>>On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
>>>><robinski[ at ]westnet.com.au> wrote:
>>>>
>>>>
>>>>
>>>>>Thanks Doug,
>>>>>
>>>>>Error message says:
>>>>>
>>>>>"Not supported"
>>>>>
>>>>>Robin
>>>>>
>>>>>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
>>>>><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>>>You can dynamically alter the InputMask property.
>>>>>>
>>>>>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>>>>>
>>>>>>or
>>>>>>
>>>>>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>>>>>
>>>>>>in the AfterUpdate property of your option button.
>>>>
>>>>
>>

Re: Alternate input masks on a form
"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> 14.09.2006 06:20:44
Hi -

The only thing I can think of is that [PhoneBH] is not a text box. If
it IS a textbox, then I don't know - the code looks fine.
Is [PhoneBH] visible when you execute the code?

Anyone?

It's going to be something obvious, of course!

John


Robin Chapple wrote:

[Quoted Text]
> John,
>
> I was missing putting my brain into gear. My apology.
>
> Here is the code behind the option button:
>
> Private Sub BHMobile_AfterUpdate()
>
> Me!PhoneBH.InputMask = "0000\ 000\ 000;0"
>
> End Sub
>
> Thanks,
>
> Robin
>
>
> On Tue, 12 Sep 2006 20:56:49 -0400, "J. Goddard"
> <jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>
>
>>Um, I don't see anything in that code that changes an input mask - am I
>>missing something?
>>
>>Are you able to determine which line is causing the error?
>>
>>John
>>
>>
>>Robin Chapple wrote:
>>
>>
>>>Thanks John,
>>>
>>>Private Sub Form_Current()
>>>
>>> Me.LastName.SetFocus
>>>
>>> If Me.NewRecord Then
>>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>>> ElseIf Len([PhoneBH] & "") = 0 Then
>>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>>> Else
>>> Me!fMobileBHSub.SetFocus
>>> Me!fMobileBHSub.Form![MemberID].SetFocus
>>> Me!fMobileBHSub.Form![MobileBH].Visible = False
>>> End If
>>>
>>> If Not IsNull(Me!fMobileBHSub.Form![MobileBH]) Then
>>> Me.[PhoneBH].Visible = False
>>> End If
>>>
>>> End Sub
>>>
>>>Cheers,
>>>
>>>Robin
>>>
>>>
>>>On Sat, 09 Sep 2006 21:19:40 -0400, "J. Goddard"
>>><jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>>
>>>
>>>
>>>>It should support it. Can you post the code that (attempts to) changes
>>>>the mask property?
>>>>
>>>>John
>>>>
>>>>
>>>>Robin Chapple wrote:
>>>>
>>>>
>>>>
>>>>>In case it is important the full message is:
>>>>>
>>>>>"Runtime error:
>>>>>
>>>>>Object does not support this property or method ""
>>>>>
>>>>>Robin
>>>>>
>>>>>On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
>>>>><robinski[ at ]westnet.com.au> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Thanks Doug,
>>>>>>
>>>>>>Error message says:
>>>>>>
>>>>>>"Not supported"
>>>>>>
>>>>>>Robin
>>>>>>
>>>>>>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
>>>>>><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>You can dynamically alter the InputMask property.
>>>>>>>
>>>>>>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>>>>>>
>>>>>>>or
>>>>>>>
>>>>>>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>>>>>>
>>>>>>>in the AfterUpdate property of your option button.
>>>>>
>>>>>
>

Re: Alternate input masks on a form
Robin Chapple <robinski[ at ]westnet.com.au> 15.09.2006 03:43:47

G'day,

[PhoneBH] is a text box and it is visible,

Robin

On Thu, 14 Sep 2006 02:20:44 -0400, "J. Goddard"
<jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:

[Quoted Text]
>Hi -
>
>The only thing I can think of is that [PhoneBH] is not a text box. If
>it IS a textbox, then I don't know - the code looks fine.
>Is [PhoneBH] visible when you execute the code?
>
> Anyone?
>
>It's going to be something obvious, of course!
>
>John
>
>
>Robin Chapple wrote:
>
>> John,
>>
>> I was missing putting my brain into gear. My apology.
>>
>> Here is the code behind the option button:
>>
>> Private Sub BHMobile_AfterUpdate()
>>
>> Me!PhoneBH.InputMask = "0000\ 000\ 000;0"
>>
>> End Sub
>>
>> Thanks,
>>
>> Robin
>>
>>
>> On Tue, 12 Sep 2006 20:56:49 -0400, "J. Goddard"
>> <jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>
>>
>>>Um, I don't see anything in that code that changes an input mask - am I
>>>missing something?
>>>
>>>Are you able to determine which line is causing the error?
>>>
>>>John
>>>
>>>
>>>Robin Chapple wrote:
>>>
>>>
>>>>Thanks John,
>>>>
>>>>Private Sub Form_Current()
>>>>
>>>> Me.LastName.SetFocus
>>>>
>>>> If Me.NewRecord Then
>>>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>>>> ElseIf Len([PhoneBH] & "") = 0 Then
>>>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>>>> Else
>>>> Me!fMobileBHSub.SetFocus
>>>> Me!fMobileBHSub.Form![MemberID].SetFocus
>>>> Me!fMobileBHSub.Form![MobileBH].Visible = False
>>>> End If
>>>>
>>>> If Not IsNull(Me!fMobileBHSub.Form![MobileBH]) Then
>>>> Me.[PhoneBH].Visible = False
>>>> End If
>>>>
>>>> End Sub
>>>>
>>>>Cheers,
>>>>
>>>>Robin
>>>>
>>>>
>>>>On Sat, 09 Sep 2006 21:19:40 -0400, "J. Goddard"
>>>><jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>>>
>>>>
>>>>
>>>>>It should support it. Can you post the code that (attempts to) changes
>>>>>the mask property?
>>>>>
>>>>>John
>>>>>
>>>>>
>>>>>Robin Chapple wrote:
>>>>>
>>>>>
>>>>>
>>>>>>In case it is important the full message is:
>>>>>>
>>>>>>"Runtime error:
>>>>>>
>>>>>>Object does not support this property or method ""
>>>>>>
>>>>>>Robin
>>>>>>
>>>>>>On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
>>>>>><robinski[ at ]westnet.com.au> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Thanks Doug,
>>>>>>>
>>>>>>>Error message says:
>>>>>>>
>>>>>>>"Not supported"
>>>>>>>
>>>>>>>Robin
>>>>>>>
>>>>>>>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
>>>>>>><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>You can dynamically alter the InputMask property.
>>>>>>>>
>>>>>>>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>>>>>>>
>>>>>>>>or
>>>>>>>>
>>>>>>>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>>>>>>>
>>>>>>>>in the AfterUpdate property of your option button.
>>>>>>
>>>>>>
>>

Re: Alternate input masks on a form
"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> 15.09.2006 04:07:56
Hi -

Well, unfortunately I don't know where else to look. I don't see
anything wrong.

I just noticed - you have a logic error in the code -

[Phonebh] will always have the same mask, regardless of what the user's
do - you have to check whether BHMobile is true or not and set the mask
accordingly.

If BHmobile then
Me!PhoneBH.InputMask = "0000\ 000\ 000;0"
else
Me!PhoneBH.InputMask = ....
endif

John




Robin Chapple wrote:

[Quoted Text]
> G'day,
>
> [PhoneBH] is a text box and it is visible,
>
> Robin
>
> On Thu, 14 Sep 2006 02:20:44 -0400, "J. Goddard"
> <jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>
>
>>Hi -
>>
>>The only thing I can think of is that [PhoneBH] is not a text box. If
>>it IS a textbox, then I don't know - the code looks fine.
>>Is [PhoneBH] visible when you execute the code?
>>
>> Anyone?
>>
>>It's going to be something obvious, of course!
>>
>>John
>>
>>
>>Robin Chapple wrote:
>>
>>
>>>John,
>>>
>>>I was missing putting my brain into gear. My apology.
>>>
>>>Here is the code behind the option button:
>>>
>>>Private Sub BHMobile_AfterUpdate()
>>>
>>> Me!PhoneBH.InputMask = "0000\ 000\ 000;0"
>>>
>>>End Sub
>>>
>>>Thanks,
>>>
>>>Robin
>>>
>>>
>>>On Tue, 12 Sep 2006 20:56:49 -0400, "J. Goddard"
>>><jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>>
>>>
>>>
>>>>Um, I don't see anything in that code that changes an input mask - am I
>>>>missing something?
>>>>
>>>>Are you able to determine which line is causing the error?
>>>>
>>>>John
>>>>
>>>>
>>>>Robin Chapple wrote:
>>>>
>>>>
>>>>
>>>>>Thanks John,
>>>>>
>>>>>Private Sub Form_Current()
>>>>>
>>>>> Me.LastName.SetFocus
>>>>>
>>>>> If Me.NewRecord Then
>>>>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>>>>> ElseIf Len([PhoneBH] & "") = 0 Then
>>>>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>>>>> Else
>>>>> Me!fMobileBHSub.SetFocus
>>>>> Me!fMobileBHSub.Form![MemberID].SetFocus
>>>>> Me!fMobileBHSub.Form![MobileBH].Visible = False
>>>>> End If
>>>>>
>>>>> If Not IsNull(Me!fMobileBHSub.Form![MobileBH]) Then
>>>>> Me.[PhoneBH].Visible = False
>>>>> End If
>>>>>
>>>>>End Sub
>>>>>
>>>>>Cheers,
>>>>>
>>>>>Robin
>>>>>
>>>>>
>>>>>On Sat, 09 Sep 2006 21:19:40 -0400, "J. Goddard"
>>>>><jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>It should support it. Can you post the code that (attempts to) changes
>>>>>>the mask property?
>>>>>>
>>>>>>John
>>>>>>
>>>>>>
>>>>>>Robin Chapple wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>In case it is important the full message is:
>>>>>>>
>>>>>>>"Runtime error:
>>>>>>>
>>>>>>>Object does not support this property or method ""
>>>>>>>
>>>>>>>Robin
>>>>>>>
>>>>>>>On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
>>>>>>><robinski[ at ]westnet.com.au> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Thanks Doug,
>>>>>>>>
>>>>>>>>Error message says:
>>>>>>>>
>>>>>>>>"Not supported"
>>>>>>>>
>>>>>>>>Robin
>>>>>>>>
>>>>>>>>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
>>>>>>>><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>You can dynamically alter the InputMask property.
>>>>>>>>>
>>>>>>>>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>>>>>>>>
>>>>>>>>>or
>>>>>>>>>
>>>>>>>>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>>>>>>>>
>>>>>>>>>in the AfterUpdate property of your option button.
>>>>>>>
>>>>>>>
>

Re: Alternate input masks on a form
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 15.09.2006 11:48:25
You need to ensure that's what put in the InputMask has quotes around it:

If BHmobile then
Me!PhoneBH.InputMask = """0000\ 000\ 000;0"""
else
Me!PhoneBH.InputMask = ....
endif

or

If BHmobile then
Me!PhoneBH.InputMask = Chr$(34) & "0000\ 000\ 000;0" & Chr$(34)
else
Me!PhoneBH.InputMask = ....
endif


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote in message
news:OHr7NvH2GHA.4932[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> Hi -
>
> Well, unfortunately I don't know where else to look. I don't see anything
> wrong.
>
> I just noticed - you have a logic error in the code -
>
> [Phonebh] will always have the same mask, regardless of what the user's
> do - you have to check whether BHMobile is true or not and set the mask
> accordingly.
>
> If BHmobile then
> Me!PhoneBH.InputMask = "0000\ 000\ 000;0"
> else
> Me!PhoneBH.InputMask = ....
> endif
>
> John
>
>
>
>
> Robin Chapple wrote:
>
>> G'day,
>>
>> [PhoneBH] is a text box and it is visible,
>>
>> Robin
>>
>> On Thu, 14 Sep 2006 02:20:44 -0400, "J. Goddard"
>> <jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>
>>
>>>Hi -
>>>
>>>The only thing I can think of is that [PhoneBH] is not a text box. If it
>>>IS a textbox, then I don't know - the code looks fine.
>>>Is [PhoneBH] visible when you execute the code?
>>>
>>> Anyone?
>>>
>>>It's going to be something obvious, of course!
>>>
>>>John
>>>
>>>
>>>Robin Chapple wrote:
>>>
>>>
>>>>John,
>>>>
>>>>I was missing putting my brain into gear. My apology.
>>>>
>>>>Here is the code behind the option button:
>>>>
>>>>Private Sub BHMobile_AfterUpdate()
>>>>
>>>> Me!PhoneBH.InputMask = "0000\ 000\ 000;0"
>>>>
>>>>End Sub
>>>>
>>>>Thanks,
>>>>
>>>>Robin
>>>>
>>>>
>>>>On Tue, 12 Sep 2006 20:56:49 -0400, "J. Goddard"
>>>><jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>>>
>>>>
>>>>
>>>>>Um, I don't see anything in that code that changes an input mask - am I
>>>>>missing something?
>>>>>
>>>>>Are you able to determine which line is causing the error?
>>>>>
>>>>>John
>>>>>
>>>>>
>>>>>Robin Chapple wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Thanks John,
>>>>>>
>>>>>>Private Sub Form_Current()
>>>>>>
>>>>>> Me.LastName.SetFocus
>>>>>>
>>>>>> If Me.NewRecord Then
>>>>>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>>>>>> ElseIf Len([PhoneBH] & "") = 0 Then
>>>>>> Me!fMobileBHSub.Form![MobileBH].Visible = True
>>>>>> Else
>>>>>> Me!fMobileBHSub.SetFocus
>>>>>> Me!fMobileBHSub.Form![MemberID].SetFocus
>>>>>> Me!fMobileBHSub.Form![MobileBH].Visible = False
>>>>>> End If
>>>>>> If Not IsNull(Me!fMobileBHSub.Form![MobileBH]) Then
>>>>>> Me.[PhoneBH].Visible = False
>>>>>> End If
>>>>>>
>>>>>>End Sub
>>>>>>
>>>>>>Cheers,
>>>>>>
>>>>>>Robin
>>>>>>
>>>>>>
>>>>>>On Sat, 09 Sep 2006 21:19:40 -0400, "J. Goddard"
>>>>>><jrgoddard[ at ]NO_cyberus_SPAM.ca> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>It should support it. Can you post the code that (attempts to)
>>>>>>>changes the mask property?
>>>>>>>
>>>>>>>John
>>>>>>>
>>>>>>>
>>>>>>>Robin Chapple wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>In case it is important the full message is:
>>>>>>>>
>>>>>>>>"Runtime error:
>>>>>>>>
>>>>>>>>Object does not support this property or method ""
>>>>>>>>
>>>>>>>>Robin
>>>>>>>>
>>>>>>>>On Sun, 10 Sep 2006 10:27:27 +1000, Robin Chapple
>>>>>>>><robinski[ at ]westnet.com.au> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>Thanks Doug,
>>>>>>>>>
>>>>>>>>>Error message says:
>>>>>>>>>
>>>>>>>>>"Not supported"
>>>>>>>>>
>>>>>>>>>Robin
>>>>>>>>>
>>>>>>>>>On Sat, 9 Sep 2006 17:24:54 -0400, "Douglas J. Steele"
>>>>>>>>><NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>You can dynamically alter the InputMask property.
>>>>>>>>>>
>>>>>>>>>>Me!MyTextBox.InputMask = "00\ 0000\ 0000;0"
>>>>>>>>>>
>>>>>>>>>>or
>>>>>>>>>>
>>>>>>>>>>Me!MyTextBox.InputMask = "0000\ 000\ 000;0"
>>>>>>>>>>
>>>>>>>>>>in the AfterUpdate property of your option button.
>>>>>>>>
>>>>>>>>
>>
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net