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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interrupt OnClose Event

Status
Not open for further replies.

VegasUser

Technical User
Feb 17, 2005
12
US
I am having a major synapse lapse - I'm sure there's an easy fix for this.....

I've got a simple pop-up form for contacts, but if the c_type field is "Tenant" then the c_broker field is required. I've put this in the OnClose event, but I can't figure out how to keep the form open after it errors....

If Me.c_type = "Tenant" And IsNull(Me.c_broker) Then
MsgBox "Broker is Required"
Me.c_broker.SetFocus
End If

thanks for your help! Don't talk bad about me [peace]
 
Perhaps in the Unload event instead ?
If Me!c_type = "Tenant" And Trim(Me!c_broker & "") = "" Then
MsgBox "Broker is Required"
Me!c_broker.SetFocus
Cancel = True
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Perfect!!! I figured it was something I was overlooking
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top