cannot follow file path?

R

Ron

Does anyone know what could be wrong here. I am trying to transfer text from
a text delimited file to a table. This is my code which is simply written to
understand what is going on:

Private Sub Command0_Click()
Application.FollowHyperlink
"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
DoCmd.TransferText acImportDelim, "PeachPO",
"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
End Sub

When I press the command button the file Tese.CSV opens but I get a 'Run
Time Error 2522' The Action or Method requires a file name argument. Why
does Access recognize the file name and path to follow the hyperlink but not
to transfer text. I am using Access 2000.

Thanks for any help.

Ron
 
D

Douglas J. Steele

The syntax for TransferText is:

DoCmd.TransferText [transfertype][, specificationname], tablename,
filename[, hasfieldnames][, HTMLtablename]

If PeachPO is the name of the table, you need another comma in front ot it.

If PeachPO is the specification name, you're missing the table name.
 
R

Ron

Getting closer. Now I get the message that "An expression you entered is the
wrong data type for one of the arguments". Any suggestions as to find out
what expression is the culprit?

Douglas J. Steele said:
The syntax for TransferText is:

DoCmd.TransferText [transfertype][, specificationname], tablename,
filename[, hasfieldnames][, HTMLtablename]

If PeachPO is the name of the table, you need another comma in front ot it.

If PeachPO is the specification name, you're missing the table name.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ron said:
Does anyone know what could be wrong here. I am trying to transfer text
from
a text delimited file to a table. This is my code which is simply written
to
understand what is going on:

Private Sub Command0_Click()
Application.FollowHyperlink
"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
DoCmd.TransferText acImportDelim, "PeachPO",
"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
End Sub

When I press the command button the file Tese.CSV opens but I get a 'Run
Time Error 2522' The Action or Method requires a file name argument. Why
does Access recognize the file name and path to follow the hyperlink but
not
to transfer text. I am using Access 2000.

Thanks for any help.

Ron
 
D

Douglas J. Steele

Given you have at most 6 arguments, it shouldn't be that hard. <g>

To what have you changed your code?

(BTW, forgot to mention previously that there doesn't appear to be any point
to the FollowHyperlink. That's simply going to open the file, likely in
Excel, which could cause contention problems)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ron said:
Getting closer. Now I get the message that "An expression you entered is
the
wrong data type for one of the arguments". Any suggestions as to find out
what expression is the culprit?

Douglas J. Steele said:
The syntax for TransferText is:

DoCmd.TransferText [transfertype][, specificationname], tablename,
filename[, hasfieldnames][, HTMLtablename]

If PeachPO is the name of the table, you need another comma in front ot it.

If PeachPO is the specification name, you're missing the table name.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ron said:
Does anyone know what could be wrong here. I am trying to transfer text
from
a text delimited file to a table. This is my code which is simply written
to
understand what is going on:

Private Sub Command0_Click()
Application.FollowHyperlink
"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
DoCmd.TransferText acImportDelim, "PeachPO",
"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
End Sub

When I press the command button the file Tese.CSV opens but I get a
'Run
Time Error 2522' The Action or Method requires a file name argument.
Why
does Access recognize the file name and path to follow the hyperlink
but
not
to transfer text. I am using Access 2000.

Thanks for any help.

Ron
 
R

Ron

I added a comma in front of the table name PeachPO.
The only reason I have the FollowHyperlink is to see if Access can find the
file by that path. I thought maybe something was wrong with the path.


Douglas J. Steele said:
Given you have at most 6 arguments, it shouldn't be that hard. <g>

To what have you changed your code?

(BTW, forgot to mention previously that there doesn't appear to be any point
to the FollowHyperlink. That's simply going to open the file, likely in
Excel, which could cause contention problems)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ron said:
Getting closer. Now I get the message that "An expression you entered is
the
wrong data type for one of the arguments". Any suggestions as to find out
what expression is the culprit?

Douglas J. Steele said:
The syntax for TransferText is:

DoCmd.TransferText [transfertype][, specificationname], tablename,
filename[, hasfieldnames][, HTMLtablename]

If PeachPO is the name of the table, you need another comma in front ot it.

If PeachPO is the specification name, you're missing the table name.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Does anyone know what could be wrong here. I am trying to transfer text
from
a text delimited file to a table. This is my code which is simply written
to
understand what is going on:

Private Sub Command0_Click()
Application.FollowHyperlink
"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
DoCmd.TransferText acImportDelim, "PeachPO",
"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
End Sub

When I press the command button the file Tese.CSV opens but I get a
'Run
Time Error 2522' The Action or Method requires a file name argument.
Why
does Access recognize the file name and path to follow the hyperlink
but
not
to transfer text. I am using Access 2000.

Thanks for any help.

Ron
 
D

Douglas J. Steele

Rather than FollowHyperlink to see whether the path is correct, use:

If
Len(Dir("\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\Test.CSV"))
' the file exists
Else
' the file doesn't exist
End If

Can you import the file manually? If so, try creating a specification (use
the Advanced button on the Wizard) and see if you can use that specification
with TransferText.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ron said:
I added a comma in front of the table name PeachPO.
The only reason I have the FollowHyperlink is to see if Access can find
the
file by that path. I thought maybe something was wrong with the path.


Douglas J. Steele said:
Given you have at most 6 arguments, it shouldn't be that hard. <g>

To what have you changed your code?

(BTW, forgot to mention previously that there doesn't appear to be any point
to the FollowHyperlink. That's simply going to open the file, likely in
Excel, which could cause contention problems)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ron said:
Getting closer. Now I get the message that "An expression you entered
is
the
wrong data type for one of the arguments". Any suggestions as to find out
what expression is the culprit?

message
The syntax for TransferText is:

DoCmd.TransferText [transfertype][, specificationname], tablename,
filename[, hasfieldnames][, HTMLtablename]

If PeachPO is the name of the table, you need another comma in front
ot
it.

If PeachPO is the specification name, you're missing the table name.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Does anyone know what could be wrong here. I am trying to transfer text
from
a text delimited file to a table. This is my code which is simply
written
to
understand what is going on:

Private Sub Command0_Click()
Application.FollowHyperlink

"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
DoCmd.TransferText acImportDelim, "PeachPO",

"\\WOPR2\Data$\Network_Admin\Developed_Software\FinalFunctionalOrderGuideDB\
Test.CSV"
End Sub

When I press the command button the file Tese.CSV opens but I get a
'Run
Time Error 2522' The Action or Method requires a file name argument.
Why
does Access recognize the file name and path to follow the hyperlink
but
not
to transfer text. I am using Access 2000.

Thanks for any help.

Ron
 
Top