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

Need a way to interrupt my IsNull MsgBox if user wants to restart 1

Status
Not open for further replies.

JSD

Technical User
Jan 18, 2002
189
US
Hello,

I am trying to add a restart button to a form in case user messes up. Button does an Me.undo and sets focus back to first control on form. The problem is when they hit the start over button when they are in a required field. My required fields have If IsNull, Then MsgBox functions and if I hit the start over when I'm in one of these fields, I get the required field Msg instead. Is there a workaround on this? Many thanks as always.

Jeremy
 
How about using a flag? Dimension a boolean variable that is set when a user hits the restart button. Then test the flag along with the IsNull for each required field, e.g.

If IsNull(MyField) AND MyFlag = False THEN MsgBox

Because the flag will be true when the restart button is clicked the MsgBox test will fail.

Don't forget to clear the flag when the cursor hits the restart point.

AvGuy
 
AvGuy,

Hello and thanks for your advice. Could I pester you for more? I understand the logic of what you are saying, however I do not have any experience in dimensioning boolean variables. I was thinking maybe just moving all of my IsNull functions to an exit button on the form if I had to, and then restart button wouldn't trip anything. I didn't want to have to do this. Any further direction is greatly appreciated.

Jeremy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top