473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Error on Form with VBA

I have an error on a webpage of mine since I added a function to save
the data in Proper Case-- but a smarter proper case. The page is not
displayed so I don't know where the error is or how to fix it
(obviously.) Here is the code:

Function MakeProper(var)

If Len(var) > 0 then

strV = var
bCaps = True

For i = 1 To Len(strV)
Select Case UCase(Mid(strV, i, 2))
Case " A"
bCaps = False
strV = Left(strV, i - 1) & UCase(Mid(strV, i, 2)) &
LCase(Mid(strV, i + 2))
i = i + 2
End Select

Select Case UCase(Mid(strV, i, 3))
Case " DL", " HR", " BB", " OK"
bCaps = False
strV = Left(strV, i - 1) & UCase(Mid(strV, i, 3)) &
LCase(Mid(strV, i + 3))
i = i + 3
End Select

Select Case UCase(Mid(strV, i, 4))
Case " MLB", " NFL", " RBI"
bCaps = False
strV = Left(strV, i - 1) & UCase(Mid(strV, i, 4)) &
LCase(Mid(strV, i + 4))
i = i + 4
End Select

If bCaps = True Then
strV = Left(strV, i - 1) & UCase(Mid(strV, i, 1)) &
LCase(Mid(strV, i + 1))
End If

If i <= Len(strV) Then
Select Case Asc(Mid(strV, i, 1))
Case 32, 45, 46, 47, 95
bCaps = True
Case Else
bCaps = False
End Select
End If
Next i

MakeProper= strV
else
MakeProper= var
end if
i = 0
End Function
Jul 19 '05 #1
2 1271
bl********@home.com (RIck) wrote in message news:<45**************************@posting.google. com>...
I have an error on a webpage of mine since I added a function to save
the data in Proper Case-- but a smarter proper case. The page is not
displayed so I don't know where the error is or how to fix it
(obviously.) Here is the code:


I should also add that the code works in MS Access after some minor
modifications. That's where I originally created the code.
Jul 19 '05 #2
ok, thanks for you help everyone... ;)

The problem was the line "next i" I had to change it to "next". It's
possible there were other problems, but if there were I didn't catch
them as I fixed it.

bl********@home.com (RIck) wrote in message news:<45**************************@posting.google. com>...
bl********@home.com (RIck) wrote in message news:<45**************************@posting.google. com>...
I have an error on a webpage of mine since I added a function to save
the data in Proper Case-- but a smarter proper case. The page is not
displayed so I don't know where the error is or how to fix it
(obviously.) Here is the code:


I should also add that the code works in MS Access after some minor
modifications. That's where I originally created the code.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: WindAndWaves | last post by:
Hi Gurus The page below has a strange error. It seems to be working very well, just when you enter 8 or 9 for day, month or year then you get an error. I really have no idea where that is...
8
by: Steve | last post by:
I have several pairs of synchronized subforms in an application. I have a Delete button for each pair that uses the following code or similar to delete a record in the second subform: ...
3
by: Michael | last post by:
Hello again everyone, Hope you can help. I have a form with a lot of code going on in the background but I can't find the route cause of the following error message. Update or Cancel Update...
2
by: Julia Baresch | last post by:
Hi everyone, As some of you may know, we've been having trouble with an unrecognized database format error. Today I installed an unfinished project on the workstation of one of my users. ...
14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
16
by: Paul S. Natanson | last post by:
What is a Null Reference error and how do I fix it? My newly installed VB.Net2003 gives me a "Microsoft Development Environment" error message box EVERY time I try to run/start ANY project -...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
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
0
BarryA
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.