Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2005

Tip: Looking for answers? Try searching our database.

populating hidden fields on record save

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Theresa - 31 May 2005 13:57 GMT
I am working on a database that 3 people will be entering data into at the
same time.  I want to save the user ID of the person who entered the record
and the date and time it was saved.  They will be filling in information
for four different tables on one form.  I have two hidden fields (one for
user ID and the other for the date and time).  I want to populate these two
fields only when the record is saved.  I have the default value for the
date and time set to Now().  Where do I put the code to populate the user
ID?  Not every field on the form will be populated.  The data entry clerks
will have several options for saving a record (clicking on a save button at
the bottom of the form, by using the enter or tab keys on the last field,
or by clicking on an add new record button).  Do I need to call my function
that gets the UserID from the system from every possible way of saving the
record?  Or is there one event for the form that I can use?  

Thanks in advance!
Theresa
Theresa - 31 May 2005 14:09 GMT
  I have another question.  If I have the user ID set to Required in my
table, can I use the AfterInsert event to populate that field?  Or is there
a better way to accomplish this?

Thanks!
Theresa
Lynn Trapp - 31 May 2005 16:35 GMT
AfterInsert will work but the BeforeInsert event gives you more flexibility
because it has a Cancel parameter that can get set to yes if the user
decides they don't want to enter the record after all.

Signature

Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html

>   I have another question.  If I have the user ID set to Required in my
> table, can I use the AfterInsert event to populate that field?  Or is
[quoted text clipped - 3 lines]
> Thanks!
> Theresa
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.