Selasa, 19 Juli 2011

[AccessDevelopers] Re: need a string function

 

Duane good answer, however, I have turned off any Access popup stuff. I want the user(abuser type) to be stopped from going any further so your suggestion aided me to try this which is working fine.
'
Private Sub txtFirstName_LostFocus()
If Mid(Me.txtFirstName, 1, 3) = "xxx" Then
MsgBox "Bad Name"xx
End If
'
--- In AccessDevelopers@yahoogroups.com, Duane Hookom <duanehookom@...> wrote:
>xx
>
> Where are you using this code? Is it in some before or after update event?
> I believe you could use the validation rule rather than code.
>
> Duane Hookom
> MS Access MVP
>
>
>
>
> To: AccessDevelopers@yahoogroups.com
> From: backyardautopart@...
> Date: Tue, 19 Jul 2011 03:21:45 +0000
> Subject: [AccessDevelopers] need a string function
>
>
>
>
>
>
> If Me.txtLastName = Left("xxx", 3) Then MsgBox "Not a good name", vbOKOnly + vbCritical, "Important Program"
> Me.txtLastName = Null
> Me.txtFirstName = Null
> End If
> If the user puts in 4x's then the Msgbox is bypassed by Access. I want the MsgBox to show up everytime.
>

__._,_.___
Recent Activity:

Please zip all files prior to uploading to Files section.
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar