Environ('USERNAME') error

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top