Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing File

Status
Not open for further replies.

hongbin81

Technical User
Jul 4, 2003
61
KR
I created an Import Command button ( DoCmd.RunCommand acCmdImport ) which works exactly the same as the on in the File menue = > Get External Data => Import.

It works except that, when I press my Import Button and Cancel, I get an error. Is there a separate code when Canceling the import??

 
I dont think you can get away from that error.. but you can do something like this

Dim Resp As Integer
Dim Cancel As Boolean

Resp = MsgBox("Are You Sure You Want to Import ?", _
vbYesNo, "Import ?")
If Resp = vbYes Then
DoCmd.RunCommand acCmdImport
Cancel = False
Else
Cancel = True
End If
Exit Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top