Question about a form bound to a table

greaseman

Closer to seniority!
Local time
Today, 17:49
Joined
Jan 6, 2003
Messages
360
I've got a form bound to a table. On the form, some of my fields are based on the table fields, and some others are unbound. In particular, I use an unbound field in order to pull the user's name and then place it into an unbound field on the form.

Here's my questions: in an "add" process, how do I get this unbound field to come across with the bound fields and together, add an entire record? Should I code a query? If I change this userid field from unbound to bound to a field in my table, how do I then get that field to automatically populate itself, using the id of whoever is logged on? I just want to get the user's id placed onto a record when I add it through a form, but I'm having a dog of a time!

Any help is most welcome! Thanks!
 
So all you need is to place the current user name as the default value for new records?

If so, just place '=CurrentUser()' in the default value property...

???
kh
 
Last edited:
That sounds good to me! And of course, leads to another question.... what if then another person logged on and was to make some changes to the record ? Would the original userid be replaced by the changing person's userid? Should I at this point start thinking of a history / audit process?

Thank you for responding... it helps greatly when someone else can so easily show what's needed and make it so simple. :)
 
The name could change/stay the same however your business process dictates. Setting the default value would mean the value is set when the record is created and would not change. If you need an audit trail, that could be done as well but would require a more substantial design effort...

kh
 
Which is the way I'm thinking of doing. Thanks for the info! Also, I don't have any .mdw file with user data and am using a home-rolled bunch of code for security, so I don't think the CurrentUser will truly work, since by default, that function puts in an ID of 'admin' when you don't use .mdw files.

Your help is greatly appreciated in any case. Wonder when Access will ever have all the things forum members want to see?
 

Users who are viewing this thread

Back
Top Bottom