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!

Exit button...delay appearance?

Status
Not open for further replies.

Ella359

Technical User
Feb 24, 2015
7
US
Is there a way to delay the appearance of a button? I have entered all the coding to prevent a user from exiting a form without having populated all the data fields. However if they select the Exit button I've created they will be prompted to close anyway (without saving)...how do I eliminate this option or delay it until all the data has been provided? Or is better to delete the button entirely?

 
When they click the exit button that is where you can do your verification. If verification is good then close the form else prompt the user to enter desired information.
 
They are prompted to enter the desired data but then immediately following that prompt is another one asking if they'd like to exit without saving...that's what I'm trying to eliminate. I don't want that to be an option.
 
Can you show the code? I am confused. Seems kind of simple. If you are giving them the option to exit without filling in required data then do not give them that option.
 
I would have a separate button (Save or Update) next to Exit button.
You can have the Save button Enabled = False as long as there is some missing data, and enable it when all is filled in.


Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
You can do what you want using a macro with conditions.
The condition would be [Forms]![YourFormName]![YourControlName] Is Null The action is MsgBox and enter the message and behavior you would like
The next line the condition would be the same [Forms]![YourFormName]![YourControlName] Is Null the action is StopMacro.
The last line will have no condition and the action will be close.
Select the macro you built for the on click event for your button instead of the standard close form button action.

What will happen is when they click the button it will give a message if the control doesn't have anything in it.
As many conditions can be added as you need if you have more than one control required to be filled.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top