Windows NT user name function - compile error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would like to be able to track users as they create and modify records,
but I am wary of using security settings to do so (I've been having a host of
problems with the security wizard). I found a link on this site for a module
that looks up the user's Windows Login:
http://www.mvps.org/access/api/api0008.htm. I was able to create the module,
and I've set up an event procedure in my form [frmAgreement] so that Before
Update, Me![LastModifiedBy] = fOSUserName ().

The problem is that I keep on getting a message that says "Compile error:
object or library not found." The debugger highlights "String$" as the locus
of the problem. I have no idea what to do, since this code is way beyond my
ken.

Any suggestions?
 
Actually, it has nothing to do with the specific piece of code you got from
The Access Web.

Almost certainly you have a problem with your References collection. (All
Access databases contain references, which are a way of referring to another
application's or project's type library.) In general, you want to ensure
that the files referenced in an Access application exist in exactly the same
location on the client workstations as they did on the development
workstation, and that each referenced file is the same version on all
workstations. Even with a single machine, installing new software can change
the version of a referenced file, which can then cause the database to stop
working on the same machine as where it was created.

Open any code module, then select Tools | References from the menu bar.
Examine all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

For more information, see my December 2003 "Access Answers" column in
Pinnacle Publication's "Smart Access". You can download the column (and
sample database) for free at
http://www.accessmvp.com/djsteele/SmartAccess.html
 
I found the missing reference. Thanks you SO much!

Douglas J Steele said:
Actually, it has nothing to do with the specific piece of code you got from
The Access Web.

Almost certainly you have a problem with your References collection. (All
Access databases contain references, which are a way of referring to another
application's or project's type library.) In general, you want to ensure
that the files referenced in an Access application exist in exactly the same
location on the client workstations as they did on the development
workstation, and that each referenced file is the same version on all
workstations. Even with a single machine, installing new software can change
the version of a referenced file, which can then cause the database to stop
working on the same machine as where it was created.

Open any code module, then select Tools | References from the menu bar.
Examine all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

For more information, see my December 2003 "Access Answers" column in
Pinnacle Publication's "Smart Access". You can download the column (and
sample database) for free at
http://www.accessmvp.com/djsteele/SmartAccess.html

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Laura_Christian said:
Hi,

I would like to be able to track users as they create and modify records,
but I am wary of using security settings to do so (I've been having a host of
problems with the security wizard). I found a link on this site for a module
that looks up the user's Windows Login:
http://www.mvps.org/access/api/api0008.htm. I was able to create the module,
and I've set up an event procedure in my form [frmAgreement] so that Before
Update, Me![LastModifiedBy] = fOSUserName ().

The problem is that I keep on getting a message that says "Compile error:
object or library not found." The debugger highlights "String$" as the locus
of the problem. I have no idea what to do, since this code is way beyond my
ken.

Any suggestions?
 

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

Similar Threads

fOSUserName 17
Get User Login Name 10
Use text box to call Function 4
two criteria in DLookup 5
Default User ID 4
Current User association 3
Compile Error 2
Record UserID in form 8

Back
Top