Sub Email()
Mailadres = Text3.Text
at = InStr(Mailadres, "@")
If at = 0 Or at > 20 Then
MsgBox ("U voerde geen geldig emailadres in")
Else
nummer
End Sub
I know you can change all the text to upper or lower case but I don't know if you can do just the first. Look for the Ucase and Lcase functions.
Looking for the @ you can do several different ways. I would get the length of the string. Then loop that number of times doing a string compair looking for the @. When it is found load the loop var (i) into another variable. Then you know the position of @ in the string.
You could do the same thing with ascii. Each character has an ascii number. You could use this to do the compair in the loop. I think its Char(13) bype format. Char(13) is for a return. I use this alot when I want to put text on two lines but only use one label.
Sub Naam()
nam = Text1.Text
Nletter = Mid(name, 1, 1)
Text4.Text = Nletter
End Sub
I had this in mind, but Nletter is not the first letter that I gave in text1.text.
If i can reach the first letter, I could convert it to asci and do like you say
CharlesM said:
I know you can change all the text to upper or lower case but I don't know if you can do just the first. Look for the Ucase and Lcase functions.
Looking for the @ you can do several different ways. I would get the length of the string. Then loop that number of times doing a string compair looking for the @. When it is found load the loop var (i) into another variable. Then you know the position of @ in the string.
You could do the same thing with ascii. Each character has an ascii number. You could use this to do the compair in the loop. I think its Char(13) bype format. Char(13) is for a return. I use this alot when I want to put text on two lines but only use one label.
Sub Naam()
nam = Text1.Text
Nletter = Mid(nam, 1, 1)
ascinam = Asc(Nletter)
If ascinam < 65 Or ascinam > 90 Then
MsgBox ("De ingevoerde naam moet beginnen met een hoofdletter !!")
Else
voornaam
End If
End Sub
a = left(nam,1)
if ucase(a) = a then goto IsUpperCase
' do something if lower case
IsUpperCase:
' please, no comments from the peanut gallery about using
' GoTo's. That was a stupid rule some stupid person invented
' and too many people took it seriously.