help on message box code needed

dxp

Registered User.
Local time
Today, 01:47
Joined
Jun 5, 2006
Messages
62
Hi All,:confused: need some code help again, I dont seem to be able to get the hang of message boxes!! The code below takes the path to a mdb file which is stored in a text box on my form, it then deletes an existing table -Expire-and replaces it with a new table also called Expire from the database located at the file path in the text box.

Private Sub Command6_Click()
Dim tmpFilePath As String
tmpFilePath = Me!Text1

DoCmd.DeleteObject acTable, "Expire"
DoCmd.TransferDatabase acImport, "Microsoft Access", tmpFilePath, acTable, "Expire", "Expire", False
DoCmd.Close

End Sub


What I would like to happen is; when the process has finished a message box pops up and informs the user that:

"the update has been successfull, your DentureBase V2 licence key has been updated"

the form then closes. If it is at all possible I would then like the db to close and restart (but this is not essential).

Once again I appeal to your generousity, many thanks:D
 
Code:
Private Sub Command6_Click()
Dim tmpFilePath As String
tmpFilePath = Me!Text1

DoCmd.DeleteObject acTable, "Expire"
DoCmd.TransferDatabase acImport, "Microsoft Access", tmpFilePath, acTable, "Expire", "Expire", False
Msgbox "the update has been successfull, your DentureBase V2 licence key has been updated", vbokonly
DoCmd.Close

End Sub

closing the application can be done by
application.quit
but i dont think u can open it back up with vb. i may be wrong though
 
Thanks RainMan89, what I had been doing was putting a period mark after MsgBox, idiot that I am.. my coding skill seem to non existant, god knows what I would do without this forum.

Dont supose you would know a way of validating that the process has in fact been successful?

many thanks for your help
 
i dont off the top of my head... sorry ... but im sure someone here does
 

Users who are viewing this thread

Back
Top Bottom