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.