[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

Function univaible in expression?

This is very confusing, I have developed an access database, the tables are linked to a text file which is updated each day. In a query I have entered: Week: Val(Format([Date],"ww")-1). The program works on 4 pc's in the department, but on other pc's with the same version of access and spec I am recieving an error.  Function is not availible in expression in query expression Val(Format([Date],"ww")-1).

I created a new database on the pc that showed the error, entered the same expression into a query and it works.

Is there something in access(permissions etc.) that need to be changed? How do I solve this problem?
1 Solution
     I am confused also. Problems where things work on one machine but not another are really tough. Anyway please excuse my slowness and confusion but let me ask you this question. On the machines that you get this error can you log into the database as the user that logs into that machine and then open the table with date in it? I have seen that sometimres problems like this are caused by lack of underlying permissions to the table, eitheir by through the network (attached table no permissions to the mdb that the table is from) or from access itself.
Also can you tell me how the tables are linked to the text file? Thanks
John Smith
Check your versions of the files comctrl.ocx and comdlg.ocx..  I had this problem and the older version produced the results you described.  Copy the newer files to c:\winnt\system32 on the problematic machine.
HidihiAuthor Commented:
I have logged onto the machine myself but still get the error. The program run a macro which deletes a table, then runs a make table query. I am unable to open the query through design or open, as it shows the error.

The tables are linked by the Link Table in New.

The database is stored on the server and the user goes in through a shortcut which runs a batch file mapping to the driver. This is fine as access opens and the macro starts but fails at the query.
Open a module in design. Run a compile on all modules and then select Tools, References (on the machine that has the problem) Now if any of the lines checked says missing, then you have something to work on. You can also try reinstalling Access.

Also have a look at the files bcbell mentioned. These have come in a lot of different version, none of the compatible so you need to have the exact same set on all machines. That is if you have referenced them and/or used them in your application.
HidihiAuthor Commented:
bcbell:  I was unable to find the files you mentioned, so instead of using comctrl.ocx and comdlg.ocx we used comctl32.ocx, comdlg32.ocx. unfortunatley this did not work.

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now