Initial capital

G

gavin

How would I force the first character in a text field to be a capital (in
case the use forgot to hit the CAP key)? I guess a little bit of VBA would
be required?



Regards,



Gavin
 
G

Guest

Look in Access Help under Input Masks.
In design mode right-click on the text box and click Properties.
On the data tab place the cursor in the Input Mask field and hit F1 (help).

Read about how to manipulate the InputMask.
Try something like :
L<??????????????

Hope this helps.
 
G

gavin

Doh - I knew about input masks too!!!! I guess I was just trying to over egg
the pudding :)

Thanks, mate!



Gavin
 
V

Vincent Johns

gavin said:
How would I force the first character in a text field to be a capital (in
case the use forgot to hit the CAP key)? I guess a little bit of VBA would
be required?

Regards,

Gavin

VBA isn't necessary, though it might not be a bad idea if you want to do
this on lots of different fields. But a VBA-less solution might look
like this (for the [LastName] field of a table):

SELECT Employees.FirstName, UCase$(Left$([Employees]![LastName],1))
& Mid$([Employees]![LastName],2) AS LN
FROM Employees;

However, if I were doing it, I'd define a VBA function like this:

Public Function CapMe(Name As String) As String
CapMe = UCase$(Left$(Name, 1)) & Mid$(Name, 2)
End Function

and then call it in the query; the previous query would be rewritten
this way:

SELECT Employees.FirstName,
CapMe([Employees]![LastName]) AS LN
FROM Employees;



-- Vincent Johns <[email protected]>
Please feel free to quote anything I say here.
 
J

John Vinson

If you don't mind all the characters being uppercase, you just need to put a

Well... not quite. That won't *change* what's actually stored in the
table; what it will do is *display* the data (in whatever case it
might be entered) as if it were all caps.


John W. Vinson[MVP]
 

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

Top