Solved

Keep records of data entered in a box

Posted on 2014-03-25
2
179 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

726 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