Solved

Keep records of data entered in a box

Posted on 2014-03-25
2
175 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
Comment Utility
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
Comment Utility
Thanks!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

763 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

7 Experts available now in Live!

Get 1:1 Help Now