Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Capatilization

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Blade370 - 16 Jul 2007 12:12 GMT
I have a field in a form that requires the whole thing to be capitals. Is
there any way apart from using an input mask that would allow me to do that?

thanks
Allen Browne - 16 Jul 2007 12:38 GMT
Use the AfterUpdate event procedure of the control to convert to upper case:
       Me.[Text0] = UCase(Me.[Text0])
Replace Text0 with the name of your text box.

If you want it converted in real type, you could use the control's KeyDown
event.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a field in a form that requires the whole thing to be capitals. Is
> there any way apart from using an input mask that would allow me to do
> that?
>
> thanks
Blade370 - 16 Jul 2007 16:18 GMT
Thanks Allen that worked great. One last question is there a way to make a
user enter a minimum amount of characters, numbers etc in a certain field
before they are allowed to move to the next field?

> Use the AfterUpdate event procedure of the control to convert to upper case:
>         Me.[Text0] = UCase(Me.[Text0])
[quoted text clipped - 8 lines]
> >
> > thanks
Allen Browne - 17 Jul 2007 01:35 GMT
Use the BeforeUpdate event, and could the length of the input:

Private Sub Text0_BeforeUpate(Cancel As Integer)
   If Len(Me.Text0) < 12 Then
       Cancel = True
       MsgBox "Type at least 12 characters, or press Esc to undo."
   End If
End Sub

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Thanks Allen that worked great. One last question is there a way to make a
> user enter a minimum amount of characters, numbers etc in a certain field
[quoted text clipped - 15 lines]
>> >
>> > thanks
Blade370 - 18 Jul 2007 16:32 GMT
Brilliant Allen worked a treat. Sorry to be a pest but I have one last
question. On one of my fields I already have a before update event set up to
check that that field matches another one with the code
Private Sub COURSE_CODE_BeforeUpdate(Cancel As Integer)
If Left(Me.[course Code], 2) <> Me.[SCHOOL] Then
MsgBox "Course Code does not match the school code"
Cancel = True
End If
End Sub
How do I nest two bits of code on this event so that I can use the code you
gave me to stipulate a required field length?
As you have already guessed I a do not use VB.

Thanks Again in advance

> Use the BeforeUpdate event, and could the length of the input:
>
[quoted text clipped - 24 lines]
> >> >
> >> > thanks
Allen Browne - 18 Jul 2007 16:37 GMT
Put both between the Private Sub ... and End Sub lines.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Brilliant Allen worked a treat. Sorry to be a pest but I have one last
> question. On one of my fields I already have a before update event set up
[quoted text clipped - 43 lines]
>> >> > do
>> >> > that?
Blade370 - 19 Jul 2007 10:56 GMT
Cheers Allen that worked a treat.

Many Thanks.

> Use the BeforeUpdate event, and could the length of the input:
>
[quoted text clipped - 24 lines]
> >> >
> >> > thanks
BruceM - 16 Jul 2007 12:42 GMT
Place a greater-than sign (>) in the field's format (table design view).
You can also format a control in which the text is entered.  The text will
appear at first in whatever case the user chooses, but it will be displayed
(and stored) as upper case.  To use an input mask I think you need to allow
for the maximum number of characters that could be entered.  For instance,
>CCCCCCCCCC will allow for up to ten characters and spaces.  You can have
fewer, but not more.

>I have a field in a form that requires the whole thing to be capitals. Is
> there any way apart from using an input mask that would allow me to do
> that?
>
> thanks
Dirk Goldgar - 16 Jul 2007 16:04 GMT
> Place a greater-than sign (>) in the field's format (table design
> view). You can also format a control in which the text is entered. The
> text will appear at first in whatever case the user chooses, but
> it will be displayed (and stored) as upper case.

No, you're mistaken about that.  If you use the Format property to force
the text display into upper case, that won't cause the value to be
stored in upper case.  It will still be stored in lower or mixed case if
it was entered that way.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

BruceM - 16 Jul 2007 19:09 GMT
>> Place a greater-than sign (>) in the field's format (table design
>> view). You can also format a control in which the text is entered. The
[quoted text clipped - 5 lines]
> in upper case.  It will still be stored in lower or mixed case if it was
> entered that way.

The text appeared in upper case when I viewed the table directly, so I
mistakenly stated that it was stored that way.
Dirk Goldgar - 16 Jul 2007 20:03 GMT
>>> Place a greater-than sign (>) in the field's format (table design
>>> view). You can also format a control in which the text is entered.
[quoted text clipped - 8 lines]
> The text appeared in upper case when I viewed the table directly, so I
> mistakenly stated that it was stored that way.

If you had the Format property of the field in the table set to ">",
that's the way you'd see it when looking at the table datasheet -- but
it still wouldn't be stored that way.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.