Hi All,
I'm new to this forum and am just convert a database to Access 2003, most things have worked once converted all but import code for importing external data.
I have the following code assign to an button on the main menu form.
Code:
Private Sub Command49_Click()
On Error GoTo Command49_Click_Err
Name "\\gbw607sc0080\everyone\system spares\WCS\data\WCS_406P_" & Text12.Value As "\\gbw607sc0080\everyone\system spares\WCS\data\WCS_406P_" & Text12.Value.txt
DoCmd.TransferText acImportDelim, "dataimport2", "Master Data", "\\gbw607sc0080\everyone\system spares\WCS\data\WCS_406P_" & Text12.Value.txt, False, ""
MsgBox ("WCS data File Succesfully Imported!")
DoCmd.RunMacro ("Append_Update")
DoCmd.Requery
List59.Requery
retrievalschart.Requery
manstchart.Requery
Exceptchart.Requery
checkinlineschart.Requery
checkinsrchart.Requery
checkinitemschart.Requery
PutawayChart.Requery
DZMovesProd.Requery
DZMoves.Requery
WDLP.Requery
WDLP1.Requery
Storage.Requery
MPutaway.Requery
Retrievals.Requery
NormalOmit.Requery
langlicence.Requery
langprod.Requery
LangSR.Requery
LangLines.Requery
LangItems.Requery
Command49_Click_Exit:
Exit Sub
Command49_Click_Err:
MsgBox Error$
Resume Command49_Click_Exit
End Sub
When clicking the button i get the following message appear
Object required
Not sure whats missing but think it could be the code thats highlighted red cause if i change this to the correct name it works fine. I have a text box of the form which i what it to use to complete the filename as the file name is always WCS_406P_yyyymmdd which is what is in the text box.
Any help on this would be fantastic.
Thanks
Dave