User Id or Adding Hard Coded Values to records

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

Guest

I have a table that has User Id as one of the fields. Each user will update
rows that match his/hers User Id. But, how do you set the User Id field
before a record is added? I know how to get the User Id. but I don't know how
to set the field to the value before the record is added. I know how to do it
for VB6 or VB.NET. But, Access is goofier.
 
kdonhowe said:
I have a table that has User Id as one of the fields. Each user will update
rows that match his/hers User Id. But, how do you set the User Id field
before a record is added? I know how to get the User Id. but I don't know
how
to set the field to the value before the record is added. I know how to do
it
for VB6 or VB.NET. But, Access is goofier.

You don't say how you are adding records. Is this an all-Access
application? Does it use bound forms? Are you using user-level security?
If you are, just use CurrentUser to return the username of the person logged
on, if not, how are people logging on? Being able to do it in VB6 and
VB.NET but failing to work it out in Access sounds pretty goofy to me.
 
Put code in the form's BeforeUpdate event that assigns the User Id to the
field.
 
Back
Top