User Id or Adding Hard Coded Values to records

K

kdonhowe

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.
 
S

Stefan Kowalski

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.
 
D

Douglas J. Steele

Put code in the form's BeforeUpdate event that assigns the User Id to the
field.
 

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