Solved

Writing a record to a table.

Posted on 2016-09-20
2
27 Views
Last Modified: 2016-09-20
I have a bunch of tables with various bits of information and status updates on them but what I want to do is create a table called tbl_StatusUpdates and need some help writing the code to record the update of a status.

For example on Form 1 I have one field called Status.


Every time someone updates this field, I want in the tbl_status table to record, the name of the status, the date the record was updated and the Environ("User") of the person.

I think it should be pretty easy but I'm not sure how to go to table create a new record and then add these three pieces of data, any ideas?
0
Comment
Question by:mtrussell
  • 2
2 Comments
 
LVL 19

Accepted Solution

by:
Eric Sherman earned 500 total points
ID: 41806508
You can use the AfterUpdate Event of your Status control on the form to run SQL that will append the 3 fields of data to your table.

Let me know if you need details.

ET
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 41806549
Here is a sample ...

DoCmd.RunSQL "INSERT INTO  tbl_StatusUpdates ( STATUS_NAME, DATE_UPDATED, USER_NAME ) " & _
    "Values ('" & Forms!Form1!TxtStatus_Name & "', #" & DATE() &"#, '" & Environ('User') &"');"

ET
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Unbound TextBox: Change color when clicked 5 14
Resize text 4 17
Access 2016 - IIf in a Query question 3 7
SQL Query 3 0
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now