I am trying to learn some aspects of vba and based on reading some things and pure trial and error, I dont think i'm getting very far. I'm really jumping the gun as i have a class next month.
In any case, can anyone help me out with this. The intention for this is when i click a button on a form the message pops up and depending on the button chosen something happens.
If I click yes, macro runs, if i choose no, the window closes. Once I figure this part out, I will likely make the no button open a new message indicating command canceled or something to that afect.
In any case, can anyone direct me with the code problem?
In any case, can anyone help me out with this. The intention for this is when i click a button on a form the message pops up and depending on the button chosen something happens.
If I click yes, macro runs, if i choose no, the window closes. Once I figure this part out, I will likely make the no button open a new message indicating command canceled or something to that afect.
In any case, can anyone direct me with the code problem?
Code:
Public Sub command9_click()
Dim answer As Byte, msg As String
answer = MsgBox(" Running this command will transfer all pending jobs whose dates have already passed to the main database table then delete them from Pending status, Is this what you want to do?", vbYesNo, "question")
If [vbYes] Then
DoCmd.RunMacro "macro1"
Else
End If
End Sub