message news:
[email protected]...
yes there is a way, what you need to do is have a field in
the table the you want to place the current user's name
into. Then when you programmatically add the new record to
the table you would
With tablename
.Add
.mytablefieldname.value = CurrentUser().value
.adddate - Now()
end with
Something like that.
Sorry, that code will not work at all!
Lisa, here is what you need to do.
1. Add two new fields CreatedBy (text) and UpdatedBy (text) to each of the
tables on which your forms are based.
2. In the Form_BeforeUpdate event of each of those forms, add something like
this:
if me.newrecord then
me![CreatedBy] = Currentuser()
else
me![UpdatedBy] = Currentuser()
endif
3. Use Tools:Security to add some new users (Tom, Dick, Mary etc.)
4. Add a password to the Admin user.
Now, when anyone opens the database, they must enter a valid username (say,
Tom). Then, when they add or edit records using your forms, the form will
put their name into the relevant field of the relevant table.
HTH,
TC
.