Validation Rule

M

M. Hamzah Khan

Hi everyone,

I was wondering if anyone can help me with this validation rule:
L<CCCCCCCCCCCC which means first letter with be capital and the rest
lower case, but i want to enter Blahblha-Blah (ie another uppercase
letter), I can't figure out how to make my validation rule allow this.

Can anyone help me?

Hamzah
 
J

John W. Vinson

Hi everyone,

I was wondering if anyone can help me with this validation rule:
lower case, but i want to enter Blahblha-Blah (ie another uppercase
letter), I can't figure out how to make my validation rule allow this.

Validation rules simply aren't flexible enough to do this, as best as I can
tell. You'll need to either write VBA code to do the testing in the
BeforeUpdate event of a Form control, or train your users.


John W. Vinson [MVP]
 
M

M. Hamzah Khan

John said:
Validation rules simply aren't flexible enough to do this, as best as I can
tell. You'll need to either write VBA code to do the testing in the
BeforeUpdate event of a Form control, or train your users.


John W. Vinson [MVP]


Ah i see, well this is just something simple ^^ i'll leave validation out
 
J

John W. Vinson

Ah i see, well this is just something simple ^^ i'll leave validation out

One thing I've done is to just *check* for all lower case and invite the user
to correct it. You can use a textbox's BeforeUpdate event:

Private Sub txtMyTextbox_BeforeUpdate(Cancel as Integer)
Dim iAns As Integer
If StrComp(Me!txtMyTextbox, LCase(Me!txtMyTextbox, 0) = 0 Then
iAns=MsgBox("Do you really want all lower case?", vbYesNo)
If iAns = vbNo Then
Cancel = True
End If
End If
End Sub

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