Capitials

  • Thread starter Thread starter MartinR
  • Start date Start date
M

MartinR

Hello!

I was wondering what properties or code do I need so that whatever I
enter into a field on a form it will always be stored in capital
letters??

All help would be appriciated! Thanks
 
Martin,

On the After Update event of the control on the form, put code like this...
Me.NameOfControl = UCase(Me.NameOfControl)
 
Hi Martin,

You should be able to use either the UCase function or the StrConv function.
From the Immediate Window (open with Ctrl G), enter the following:

?UCase("my name is martin")
or
?StrConv("my name is martin", 1)

both return ---> MY NAME IS MARTIN

On a form, you can use either of these functions in the BeforeUpdate event
procedure for the textbox in question.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
I can't get this to work.
I don't know what I'm doing wrong. I went to my form in design view and
then at the After Update field under properties I typed the following:
Me.Invoice# = UCase(Me.Invoice#)
Invoice# is the name of my field.
I save and then I go to my form and try it out and this is what I get:
Microsoft Office Access Can't find the macro Me.
The marco (Or its macro group doesn't exist, or the macro is new but hasn't
been saved. Note that when you enter a macrogroupname.macroname syntax in an
argument, you must specify the name the Macro's macro group was last saved
under.
What am I doing wrong?
 
Dawg,

First of all, as an aside, it is not a good idea to use a # as part of
the name of a field or control. I recommend you change it.

Go back to the design of your form, and find the After Update property
of the Invoice# control. Instead of what you put in there. enter [Event
Procedure] (this will be available from the drop-down list for the
property box). Then click the little ellipsis [...] button at the
right. This will open the VB Editor window, and the cursor should be
already located between lines that say like this...
Private Sub InvoiceNumber_AfterUpdate()

End Sub

Ok, that's where you type the line of code with UCase() function.
Close and save. Try it now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top