I have two actions running on the click of a button 1) when pressed 2) when released.
Is there a command or piece of code I can enter into the first so that If conditions arent met I can cancel the second action.
I know I can do .Stop() but this deactivates my whole program and I would prefer just a message box to come up and the user is ready to enter info again.
Make a flag variable in your first function that sets to true if your condition is met and false if not met. In the second function check the value of the flag and either run your code or display the message box. i.e.
Private blnFlag as Boolean
Private Sub Function1()
If Condition = True Then
blnFlag = True
blnFlag = False
Private Sub Function2()
If blnFlag = True Then
'Run your code
MsgBox "Conditions not met."
Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!
Or try our Ask An Expert service to answer any of your questions!