Environment Variables

P

Pavithra

I have the following code in my module,

Dim DefaultWorkspace As Workspace
Dim MyDb As Database, MySecurity As Recordset

Set MyDb = CurrentDb
Set MySecurity = MyDb.OpenRecordset("Security")

MySecurity.AddNew
MySecurity!UserName = Environ$("LName")
MySecurity!LSrvr = Environ$("LSrvr")
MySecurity!LPNode = Environ$("LPNode")
MySecurity!COMPUTERNAME = Environ$("COMPUTERNAME")
MySecurity!Workgroup = Environ$("Workgroup")
MySecurity!Time = Time()
MySecurity!Date = Date

MySecurity.Update


When the application is run I get the error "Lname not
set"

My doubts are,

What does ENviron$ function do? From where does it lookup
values? from any system file or access file or do i need
to set it somewhere??If Lname is not set then where
should i go and check for its existence?

Thanks,
Pavithra.
 

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