VBYesNo Help

benkingery

Registered User.
Local time
Today, 16:06
Joined
Jul 15, 2008
Messages
153
My vb code, I'm asking the question about whether or not some data has been imported or not during a previous step. If it has not then I need to run about 5 tasks. if it has, I eliminate 3 out of those 5 steps. I need to know if there is a way to continue on with only the remaining 2 steps. Is there something like a "Go To" statement?

Here is what I have so far

Public Function Import_XXX_Shipments()

Dim Answer As Integer

Answer = MsgBox("Has Shipment Data been imported for XXX today?", vbQuestion + vbYesNo, "XXX Imported")
If Answer = 6 Then
MsgBox ("Shipment Data has been Imported!")
Do task 4 and 5
End if

If Answer = 7 Then
Do task 1, 2, 3, 4, and 5
End if
End Function
 
How are your tasks performed? You can basically use:
Code:
Public Function Import_XXX_Shipments()

Dim Answer As Integer

Answer = MsgBox("Has Shipment Data been imported for XXX today?", vbQuestion + vbYesNo, "XXX Imported")
   If Answer = 6 Then
      MsgBox ("Shipment Data has been Imported!")
      Do task 4 and 5
   Else
      Do task 1, 2, 3, 4, and 5
   End if
End Function

Your tasks could be separate functions. Also, do tasks 1, 2, and 3 need to be done before 4 and 5 if they are required?
 
Duh. I had a brain fart. I figured this out.

Thanks though.
 

Users who are viewing this thread

Back
Top Bottom