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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Problem...RunMacro

Status
Not open for further replies.

kmkland

Technical User
Dec 15, 2004
114
US
This VB script worked fine until I needed to add a RunMacro action. Now, I get an error message stating: "Compile Error: Argument not optional," with the RunMacro action high-lighted.

Code:
Private Sub Import_Click()
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "CLAIM", [Forms]![Import File]![Enter Path to File for Importing], True, "A:G"

On Error GoTo Err_Import_Click

    DoCmd.RunMacro , "Open IMPORT FILE Form", 1
    

Exit_Import_Click:
    Exit Sub

Err_Import_Click:
    MsgBox Err.Description
    Resume Exit_Import_Click
    
End Sub

I began learning VB last month, so my knowledge is extremely limited. If ANYone can help, it would be greatly appreciated!!!

Kindest Regards,
Kim
 
kmkland,

This
DoCmd.RunMacro , "Open IMPORT FILE Form", 1

should be this
DoCmd.RunMacro "Open IMPORT FILE Form", 1

And that should be that (just kidding)

Good Luck...


 
Thank you HiTech for your help! It works fine now.
Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top