Public Sub IF

Pirate

Registered User.
Local time
Today, 21:49
Joined
Jun 17, 2009
Messages
23
I have a sub reads like this:
Public Sub Quantity()
If Forms![Quoting Master]![HDPBUnderlay(persheet)Quantity] = 0 Then
DoCmd.RunMacro "No Quantity"
Else
DoCmd.OpenForm "Lane Quote Hidden"
End If
End Sub

Can I stop the sourse macro by adding DoCmd.StopMacro "Quoting" after "No Quantity" with out receiving a run time error.

At the moment I an stopping the macro by using the Action "Stop All Macros" in the macro opened in the true part of this function.
 
I didn't read closely enough when I wrote
Just use: Exit Sub

My advice would be to convert your macros into VBA where you can control all the automation from one place.
 
Think you'd find it helpful if you'd stick with one thread, rather than opening a new one for each problem with the same issue.

Bob
 
Thanks for both of your tips I will convert the macros to VBA and see how we go..
 
Converted my macros to VBA and now Im more confused than ever lucky I back up and will stick to what I know to I've learnt a lot more on code writing. I tried the"end sub" but did not solve my problem.
Can I do the 2 requests in the true part of my sub. I am trying to stop the run time out error that occurs when I stop the macro from another macro.

Pirate
 

Users who are viewing this thread

Back
Top Bottom