Solved

Keep records of data entered in a box

Posted on 2014-03-25
2
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 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