Hi,
I need to change my existing data into Uppercase, Some of the data in certain
field are in lowercase and i need them to change to uppercase. Is there a way
to change them all together in just one click?.
thanks
--
Message posted via http://www.accessmonster.com 9 5610
Hi Mike,
Easiest way is probably to roll through a recordset and use UCase to
change the existing data.
NB: You'll need to ensure you have a reference to DAO 3.6
On Error Resume Next
Dim db As DAO.Database, rs As DAO.Recordset, X As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl_Names")
rs.MoveLast
X = rs.RecordCount
rs.MoveFirst
If Not X = 0 Then
For X = 1 To X
rs.edit
rs("FirstName") = UCase(rs("FirstName"))
rs("LastName") = UCase(rs("LastName"))
rs.Update
rs.MoveNext
Next X
Select Case X - 1
Case 1
MsgBox "1 record has been converted to uppercase.", _
vbInformation + vbOKOnly, "Complete"
Case 2
MsgBox "Both records has been converted to uppercase.", _
vbInformation + vbOKOnly, "Complete"
Case Else
MsgBox "All " & X - 1 & " records have been converted to
uppercase.", _
vbInformation + vbOKOnly, "Complete"
End Select
End If
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Thank you sir!,,'preciate it...
Anton wrote: Hi Mike,
Easiest way is probably to roll through a recordset and use UCase to change the existing data.
NB: You'll need to ensure you have a reference to DAO 3.6
On Error Resume Next Dim db As DAO.Database, rs As DAO.Recordset, X As Integer Set db = CurrentDb Set rs = db.OpenRecordset("tbl_Names") rs.MoveLast X = rs.RecordCount rs.MoveFirst If Not X = 0 Then For X = 1 To X rs.edit rs("FirstName") = UCase(rs("FirstName")) rs("LastName") = UCase(rs("LastName")) rs.Update rs.MoveNext Next X Select Case X - 1 Case 1 MsgBox "1 record has been converted to uppercase.", _ vbInformation + vbOKOnly, "Complete" Case 2 MsgBox "Both records has been converted to uppercase.", _ vbInformation + vbOKOnly, "Complete" Case Else MsgBox "All " & X - 1 & " records have been converted to uppercase.", _ vbInformation + vbOKOnly, "Complete" End Select End If rs.Close db.Close Set rs = Nothing Set db = Nothing
--
Message posted via http://www.accessmonster.com
If you did not need to provide user feedback - you could create an
update query to change the relevant fields. This could reduce the code
to 2 or 3 lines - bearing in mind you need to setwarnings off.
"Nigel C" <ni************@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com... If you did not need to provide user feedback - you could create an update query to change the relevant fields. This could reduce the code to 2 or 3 lines - bearing in mind you need to setwarnings off.
Why not just use an update query? No need for any code at all:
Update to: UCase([MyField])
Regards,
Keith. www.keithwilby.com
Run a update query. Here is an example:
UPDATE Transactions SET Description = UCase(Description);
[Sorry if this gets posted three times, I'm having some issues w/google
groups...]
This seems really complex. Why not just use a simple update query?
UPDATE MyTable SET [MyField] = UCASE([MyField])
mike via AccessMonster.com wrote: Thank you sir!,,'preciate it...
Anton wrote:Hi Mike,
Easiest way is probably to roll through a recordset and use UCase to change the existing data.
NB: You'll need to ensure you have a reference to DAO 3.6
On Error Resume Next Dim db As DAO.Database, rs As DAO.Recordset, X As Integer Set db = CurrentDb Set rs = db.OpenRecordset("tbl_Names") rs.MoveLast X = rs.RecordCount rs.MoveFirst If Not X = 0 Then For X = 1 To X rs.edit rs("FirstName") = UCase(rs("FirstName")) rs("LastName") = UCase(rs("LastName")) rs.Update rs.MoveNext Next X Select Case X - 1 Case 1 MsgBox "1 record has been converted to uppercase.", _ vbInformation + vbOKOnly, "Complete" Case 2 MsgBox "Both records has been converted to uppercase.", _ vbInformation + vbOKOnly, "Complete" Case Else MsgBox "All " & X - 1 & " records have been converted to uppercase.", _ vbInformation + vbOKOnly, "Complete" End Select End If rs.Close db.Close Set rs = Nothing Set db = Nothing
-- Message posted via http://www.accessmonster.com
You would usually run a query from code - not just run the query from
the database window - so to that end I was just informing that you need
to setwarnings false to run an action query. Thats all.
"Nigel C" <ni************@hotmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com... You would usually run a query from code - not just run the query from the database window - so to that end I was just informing that you need to setwarnings false to run an action query. Thats all.
The OP didn't specify where he wanted to run it from so I assumed it would
be from the db window, it was Anton's response that suggested coding it and
my comment was really intended to illustrate to the OP that no coding was
necessary.
Regards,
Keith.
thanks men,,
I had a question:
my current format in a certain field is:
AA2C21
I want to change to AA2-C2-1 is there a way to change it in just one click?
thanks again for you help... je************@gmail.com wrote: [Sorry if this gets posted three times, I'm having some issues w/google groups...]
This seems really complex. Why not just use a simple update query? UPDATE MyTable SET [MyField] = UCASE([MyField])
Thank you sir!,,'preciate it... [quoted text clipped - 37 lines] >Set rs = Nothing >Set db = Nothing
--
Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ccess/200509/1 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Johannes Koch |
last post by:
Hi there,
I'd like to apply an xpath to both HTML and XHTML documents. First I
create a DOM document with a Java DOM parser, then apply the xpath with
Xalan's XPathAPI class. The problem is that...
|
by: programmerforhire |
last post by:
Hello all,
Is there a way to setup an ms-access table so that when I enter
text in the 'datasheet' mode, it will automatically be converted
tp upper case. Or must I use a Form for this?
rex
|
by: Janice |
last post by:
char* line = "abcd";
How to convert the line to upper case and print?
Any option for printf to do this?
Thanx
|
by: Manish |
last post by:
In my application there is need for only upper case chars..
Currently I am making entry to upper case when user leaves focus of the
text control.
I want to do some modification here...When user...
|
by: Richard MSL |
last post by:
How do you make a ComboBox force casing to uppercase? With a TextBox, I do
this:
TextBox txtName;
this.txtName.CharacterCasing = CharacterCasing.Upper;
And it makes whatever the user types...
|
by: Richard Keller |
last post by:
How can I only allow user to enter upper case letters
into a text box, and if he enters a lower case letter,
change it to upper case.
in vb6 I would use the keypress event and change the key
to...
|
by: Eric Lindsay |
last post by:
Should HTML 4.01 Strict markup be done in upper case or in lower case?
I understand that HTML allows either upper or lower case. I also notice
that XHTML apparently requires lower case. However I...
|
by: csanjith |
last post by:
Hi, i have a situaion where i need to convert the characters entered in
an text field to upper case using C. The configuration id utf8
environment in which user can enter any character (single ,...
|
by: bob |
last post by:
Now this ought to be a simple matter. But nothing's simple in the Net
world, I'm finding.
In vb6 you could use "!" to force text to upper case in the format
function. I've searched the vb.net...
|
by: titan nyquist |
last post by:
Why does ToTitleCase not work if the case is already in upper case?
I have to make my string lowercase, first, before I pass to to
ToTitleCase to have it work.
Titan
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |