Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open form when value isn't appropriate the input mask!!

Status
Not open for further replies.

Fekri

Programmer
Jan 3, 2004
284
IR
Hi,

I made an input mask on one of my text box in form.

and I need to open a specific form when the value in that text box isn't appropriate the input mask specified.

Thanks for any advise.

Ali

Thanks & Good Luck
Ali Fekri
 
How are ya Fekri . . .

[ol][li]In the code module of the form, copy/paste the following routine ([blue]you![/blue] substitute proper names/values in [purple]purple[/purple]):
Code:
[blue]Private Sub Form_Error(DataErr As Integer, Response As Integer)
    
   If DataErr = 2279 Then
      MsgBox "[purple][b]Your Message Here![/b][/purple]"
      Me("[purple][b]YourTextboxName[/b][/purple]") = Null
      DoCmd.OpenForm "[purple][b]FormName[/b][/purple]"
   End If
   
End Sub[/blue]
[/li]
[li]Perform your testing! . . .[/li][/ol]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top