Environ('USERNAME') error

G

Guest

I have some code that inserts the username, date and file location of the
..mdb file into a table called tblUsers. This works on some pc's but not
others.

Here is the code:

DoCmd.RunSQL "INSERT INTO tblUsers ([Username],[Date],[Server]) VALUES_
(Environ('USERNAME'), now(),Application.CurrentDb.Name)"

On some pc's I get the error:
Function isn't available in expressions in query expression
Environ('USERNAME').

Does anyone know why this works on some pc's and not others? Is it becuase
the function is missing from the mda file?

Many thanks,

Martin

Runtime error 3075
 
D

Dirk Goldgar

Martin said:
I have some code that inserts the username, date and file location of
the .mdb file into a table called tblUsers. This works on some pc's
but not others.

Here is the code:

DoCmd.RunSQL "INSERT INTO tblUsers ([Username],[Date],[Server])
VALUES_ (Environ('USERNAME'), now(),Application.CurrentDb.Name)"

On some pc's I get the error:
Function isn't available in expressions in query expression
Environ('USERNAME').

Does anyone know why this works on some pc's and not others? Is it
becuase the function is missing from the mda file?

Many thanks,

Martin

Runtime error 3075

See whichever of these MS KnowledgeBase articles applies to your version
of Access:

http://support.microsoft.com/default.aspx?scid=kb;en-us;239482
How to configure Jet 4.0 to prevent unsafe functions from running in
Access 2000 and Access 2002

http://support.microsoft.com/default.aspx?scid=kb;en-us;294698
How to configure Jet 4.0 to prevent unsafe functions from running in
Access 2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top