A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Function name Access can't find



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2004, 12:47 AM
Terry
external usenet poster
 
Posts: n/a
Default Function name Access can't find

Dear All,

This is a follow on from an earlier post I had in
the "External Data" group. I am still having problems and
suspect this may be a more appropriate place to ask.

Whenever I try and use the "Dir" function I get a message
saying The function name can't be found. Douglas J Steele
pointed me at the references and suggested importing all
objects into a new DB. I have re-referenced everything
Access will allow me to. Subsequent testing has shown
the "Dir" function does not work with any database. If I
enter "dir("")" into a form control it will accept it as a
function and format it to "Dir ("")" with the capital D.
The object browser finds the Dir function. The function
won't work though.

I have tried to re-register the DLLs with REGSVR32.exe.
The MSO.DLL fails to register properly .... but also fails
in the same way on PCs that are working?

I have used uninstall programs to remove Office and re-
install office (most of the shared components appear
unaffected by this) and re-applied service packs.

This fault has only shown up since an FDisk and complete
re-build of my PC (about a two day job).

I am hoping to avoid another complete rebuild. Has anyone
any suggestions, ideas, anything ... ?

Access 2002 SP3
Win2k SP4

Thanks in advance,

Terry
  #2  
Old May 4th, 2004, 01:36 AM
Albert D. Kallal
external usenet poster
 
Posts: n/a
Default Function name Access can't find

"Terry" wrote in message
...

If I
enter "dir("")" into a form control it will accept it as a
function and format it to "Dir ("")" with the capital D.


I don't think the dir command works that way. Did you even both to check the
help?

You can certainly try:

=Dir("*.*")

The above should work..but if you read the help...how can really use the dir
function directly in a control?

Where did you get such a silly idea?

Anyway, trying reading the help on dir. Also, give the above example a
try...it works on my computer...but the results are kind of useless......


--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn


  #3  
Old May 4th, 2004, 02:29 AM
Terry
external usenet poster
 
Posts: n/a
Default Function name Access can't find

Albert,

Thanks for your response.

You can use the Dir as I used in the example (it will
return the first file in the current path) however in the
live dbs it is used in code and macros to check for the
existence of text files prior to importing them and it
works on other PCs and used to work on mine. I am trying
to find out why this function "can't be found" by Access.
I really don't want to have to completely re-build my
machine in the hope that it will fix it.

Thanks for your interest and time in reading this saga,

Terry

-----Original Message-----
"Terry" wrote in

message
...

If I
enter "dir("")" into a form control it will accept it

as a
function and format it to "Dir ("")" with the capital D.


I don't think the dir command works that way. Did you

even both to check the
help?

You can certainly try:

=Dir("*.*")

The above should work..but if you read the help...how can

really use the dir
function directly in a control?

Where did you get such a silly idea?

Anyway, trying reading the help on dir. Also, give the

above example a
try...it works on my computer...but the results are kind

of useless......


--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn


.

  #4  
Old May 4th, 2004, 02:55 AM
Albert D. Kallal
external usenet poster
 
Posts: n/a
Default Function name Access can't find

Ok, does the dir command work in code?


For example, can you go in a test module:

Dim strBuf As String

strBuf = Dir("*.*")

Do While strBuf ""
Debug.Print strBuf
strBuf = Dir()

Loop

If the above code can't compile on your pc, then you still have a reference
problem

Does the above code work as a test?


--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn



  #5  
Old May 4th, 2004, 04:14 AM
Terry
external usenet poster
 
Posts: n/a
Default Function name Access can't find

Albert,

The code compiles and runs OK now ..... beats me because
it definitely wasn't working earlier (it would compile OK).

It still fails when used in a control or in a Macro.

I have quite a few text imports that will run if
Dir([forms]![myform].[FileAndPathname])"" if this type
of condition is met. I still cannot get past a
message "The expression you entered has a function name
that Access cant find". The same macros and etc used to
work and still work elsewhere?

Something appears to have changed as it will work from a
module now? The recent testing I have done was with a dir
function in a form so when it started working from within
a module I don't know.

Thanks for your input and making me revisit some areas I
have neglected. Any suggestions on where to go from here
to get it working from a Macro (and as a function in a
form which it should do).

Thanks again,

Terry


-----Original Message-----
Ok, does the dir command work in code?


For example, can you go in a test module:

Dim strBuf As String

strBuf = Dir("*.*")

Do While strBuf ""
Debug.Print strBuf
strBuf = Dir()

Loop

If the above code can't compile on your pc, then you

still have a reference
problem

Does the above code work as a test?


--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn



.

  #6  
Old May 4th, 2004, 04:50 AM
Albert D. Kallal
external usenet poster
 
Posts: n/a
Default Function name Access can't find

I am not sure what, or why there is a problem when using the expression in a
form.

You do need to use:

=Dir([Forms]![form2].[text5])""

I don't think that the following will work (that is if you are going to make
a text box on a form).

Dir([Forms]![form2].[text5])""

(you need the equal sign in front).

I have quite a few text imports that will run if
Dir([forms]![myform].[FileAndPathname])"" if this type
of condition is met. I still cannot get past a
message "The expression you entered has a function name
that Access cant find". The same macros and etc used to
work and still work elsewhere?


Hum, I would just change the macro to code..and then you can deal with it
that way.

Unfortunately, I never spent the time to use macros..and thus I don't what
works, and what does not work well.

In code, you can go:

If Dir([forms]![myform].[FileAndPathname]) "" then

do whatever

endif

At least your use of dir in code now works....

--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn



  #7  
Old May 4th, 2004, 05:09 AM
external usenet poster
 
Posts: n/a
Default Function name Access can't find

Albert,

Thanks for your guidance and help. I'll blunder along and
start converting the macros. It is still a mystery and a
pain in the proverbial.

Thanks again,

Terry

-----Original Message-----
I am not sure what, or why there is a problem when using

the expression in a
form.

You do need to use:

=Dir([Forms]![form2].[text5])""

I don't think that the following will work (that is if

you are going to make
a text box on a form).

Dir([Forms]![form2].[text5])""

(you need the equal sign in front).

I have quite a few text imports that will run if
Dir([forms]![myform].[FileAndPathname])"" if this type
of condition is met. I still cannot get past a
message "The expression you entered has a function name
that Access cant find". The same macros and etc used to
work and still work elsewhere?


Hum, I would just change the macro to code..and then you

can deal with it
that way.

Unfortunately, I never spent the time to use macros..and

thus I don't what
works, and what does not work well.

In code, you can go:

If Dir([forms]![myform].[FileAndPathname]) "" then

do whatever

endif

At least your use of dir in code now works....

--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.