Converting case type

carlchapman

Registered User.
Local time
Today, 17:39
Joined
Jul 25, 2006
Messages
29
hi peps,

I have a function to convert case type to either upper, lower, or proper -

Public Sub ConvertCaseType()

If IsNull(Screen.ActiveControl) = False Then

Screen.ActiveControl = StrConv(Screen.ActiveControl, vbUpperCase)

End If

End Sub

Is it possible to put vbUppercase as a variable or an array, where i have vbLowerCase, vbProperCase, n vbUpperCase stored, so when i call the function ConvertCaseType i can put something like ConvertCaseType(var1) ??
 
Hello
Yes.
VbUpperCase = 1
VbLowerCase = 2
VbProperCase = 3
Regards
Mark
 
Sorry i am not that good with VBA, How to i switch from the set vbUpperCase to accept one of the variables?

Public Sub ConvertCaseType()

vbUpperCase = 1
vbLowerCase = 2
vbProperCase = 3

If IsNull(Screen.ActiveControl) = False Then

Screen.ActiveControl = StrConv(Screen.ActiveControl, (VARIABLE HERE?) )

End If

End Sub

and i call the function by ConvertTypeCase. Where do i put the variable?
ConvertTypeCase(1)
 

Users who are viewing this thread

Back
Top Bottom