98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft VBA Training and help » training access vba london - Word vba
training access vba london - Word vba
Resolved · Low Priority · Version Standard
Jane has attended:
Word VBA course
Word VBA course
Word vba
am preparing a template and am asking a question which i need a message box to appear. i have inserted the following code
Private Sub EUVAT_Click()
If BillAmounts.EUVAT = Yes Then
Sub NewMessage()
MsgBox("Is the Client VAT number shown above correctly?", vbYesNo) = vbYes
End If
End Sub
when i click yes in the template BillAmounts gets highlighted and error Expected End Sub.
I would be grateful for some help, I havent done any vba since training in June !
RE: word vba
Hi Jane
The error message is due to the fact you did a Sub Newmessage in the middle of the if statement. Try the following code istead:
Private Sub EUVAT_Click()
Dim Reply As Byte
If BillAmounts.EUVAT = Yes Then
Reply = MsgBox("Is the Client VAT number shown above correctly?", vbYesNo)
If Reply = vbYes Then
'Code for Yes reply
Else
'Code for No reply
End If
End If
End Sub
Hope this helps
Carlos
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
VBA tip:Display Text In a Msgbox On Multiple LinesWhen displaying text in a MsgBox you may need to show it over multiple lines. To do this use: |