Hi everybody,
I m trying to import an Excel worksheet which is not the first thats being displayed in the overview into Access.
When I try running my VBA code its telling me that I ve entered an expression which does not have the required data type for the argument.
My Code:
Code: Option Compare Database
'------------------------------------------------------------
'
AutQry
'
'------------------------------------------------------------
Function AutQry()
On Error GoTo AutQry_Err
DoCmd.TransferSpreadsheet acImport, 10, "richtigerpfad", True, "Tabelle2!", ""
DoCmd.OpenForm "Auswahlabfrage", acNormal, "", "", , acNormal
AutQry_Exit:
Exit Function
AutQry_Err:
MsgBox Error$
Resume AutQry_Exit
End Function
What am I doing wrong?