Solved

Keep records of data entered in a box

Posted on 2014-03-25
2
177 Views
Last Modified: 2014-03-26
I am building a field of a form where a zip code will be entered. After a zip code is entered a button will be pushed that will generate a small report based on the zip code that was in the field.

How hard would it be to store date of the zip code entered as well as a time stamp of when it was entered. So every time someone enters a zip code and clicks the button, two thing will happen. First the report will show (the primary function of the button). Second, a two column table will be updated. The first column will be the zip code that was entered and the second column will be a time stamp (date and time) it was clicked.

This table will simply grow as more and more zip codes are entered.

Would this be a hard task? Thanks!
0
Comment
Question by:cansevin
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39955552
You'd have to set up a history table... eg: tblZipCodeHistory.  You would probably want to store the Primary Key field of whattever "Main Record" corresponds to your zipcode data.

The code to add a record to your history table would be along these lines:

Dim strSQL as string
strSQL = "INSERT INTO tblZipCodeHistory (MainRecordID, ZipCode, DateEntered) VALUES (" & Me.ID & ", '" & Me.ZipCode & "', Now())"
CurrentDB.Execute strSQL, dbfailonerror + dbSeeChanges

Open in new window


In this code I'm assuming:

1.  The ID of the main record is numeric
2.  Zipcode is a TEXT field

If the data types are different, the delimiters in the code would need to be adjusted accordingly.
0
 

Author Closing Comment

by:cansevin
ID: 39957626
Thanks!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

776 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