Forum 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
Word vba
am preparing a template and am asking a question which i need a message box to appear. i have inserted the following codePrivate 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 !
For upcoming training course dates see: Pricing & availability
RE: word vba
Hi JaneThe 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
|
|
» Forum post: Pivot tables |



Course updates

