?
Solved

Keep records of data entered in a box

Posted on 2014-03-25
2
Medium Priority
?
186 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 2000 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

850 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