Results 1 to 5 of 5
  1. #1
    KingOfNet is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    4

    Capture and update application user ID into modified_by_user

    I'm new to Access and forms. Have worked extensively in Oracle.

    Have a navigation subform with Default view = Continuos Forms and using a Recordsource method to populate the values.
    The Table has created_by and modified_by columns. I'm capturing the application user ID in a global variable and whenever a record is updated, the same should be captured in modified_by column.
    the query I've tried is as

    select f1,f2,f3,f4, 'uid' as Modified_By, now as Modified_Date FROM <table> where <conditions>;
    say this query returns 3 rows. All the bound textboxes show the correct values


    but I'm able to capture and update the required details only for the first record and not for 2nd and 3rd.

    any suggestions?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Try using the Before_Update method at the form level. This will fire immediately before the current record is updated, and in it you can set Modified_By = uid and Modified_date = now()

  3. #3
    KingOfNet is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    4
    hi John,
    Thanks for helping out. I tried using the solution provided by you, but the Private Sub Form_BeforeUpdate(Cancel As Integer) is called only for the first row Update button (and that too only for the first time after the form is loaded) and not for the rest. But then I called this this Form_BeforeUpdate from update_button click event. will change and test the code and will revert back

  4. #4
    KingOfNet is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    4
    it's giving me write conflict error . Cause this error itself, I've changed my "dbs.Execute StrSql" approach and have decided to go for a continuos form and recordsource method.

  5. #5
    KingOfNet is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    4
    Managed to solve the issue.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 01-01-2015, 07:34 PM
  2. Multi-user Front End application
    By emanual4real in forum Access
    Replies: 2
    Last Post: 02-24-2014, 10:44 PM
  3. how to Capture Individual User who made entries in form
    By bronson_mech in forum Programming
    Replies: 2
    Last Post: 08-19-2013, 10:07 AM
  4. Replies: 3
    Last Post: 03-11-2012, 08:24 PM
  5. Creating a Clean User Application
    By sesproul in forum Forms
    Replies: 1
    Last Post: 03-05-2010, 06:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums