I have a command button on my form to import an excel file into a table but I would like to put a warning on it incase it is pressed accidentally. What is the best way of doing this?
I tried that but it doesn't give the option of saying no
Really ?
Msg = "Are you sure you want to do that?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "Import Excel file"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
MsgBox "You said YES"
Else ' L'utilisateur a choisi Non.
MsgBox "You said NO"
End If
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Hi Again,
I'm sorry but I really don't understand that. I was hoping for a macro like the one I have to import the file but if that's not possible is there one to delete the file after I have updated the table, that would solve my problem.
I don't think you can do what you want in Access macros. In fact there's a *long* list of things you can't do in Access macros - forget them, learn a bit of basic VBA, and then use the code PHV has posted for you.
Hey - here's a work around for you. Instead of having the button do the import, why dont you have it open another form. On this form put 2 buttons, make one the import button, make the other a cancel button...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.