So you need to decide if the control need to be locked depending on whether the user did a Cancel/Close or not, correct? In other words you need to pass back to the first form the fact that the user wants to cancel this process, right?
So you need to decide if the control need to be locked depending on whether the user did a Cancel/Close or not, correct? In other words you need to pass back to the first form the fact that the user wants to cancel this process, right?
Pretty much.
Set a value in the next form and then go invisible. When the code gets back to the first form, check the value in the other form and act accordingly and then close the other form.
I'll give that a go when I get in tomorrow.
Let us know how you make out.
So ended up just throwing some code on the cancel button to change the control properties to the desired value.
One more quick question:
All of this is for salesperson payroll entry. There is a combo box with the salespeople. Is there and easy bit of code that will cause all of the controls on the entry form to go to their default values (mostly zero's) upon changed the selected salesperson? AfterUpdate is already requerying a subform and that works great. Obviously I can just add each control in the code and set it to zero, but there are ~30 controls....
Nevermind!
That did the trick. I just put a "y" in the tag field of the controls that I wanted to reset. All bueno!Code:For Each ctl In Me.Controls If ctl.ControlType = acTextBox And ctl.Tag = "y" Then ctl.Value = ctl.DefaultValue End If Next
Very cool...
Glad to hear you got everything sorted. Happy New Year.