filling in fields with previous information

  • Thread starter Morgan Gartland via AccessMonster.com
  • Start date
M

Morgan Gartland via AccessMonster.com

hello

I have a database that tracks travel expenses. I would like to be able to
populate some fields with the same information as the previous record I
entered.

For example if three people went to the same conference I would like to be
able to fill in the first persons form, then when I enter the next record I
could enter the persons name then hit a button and it automatically fill in
the date, distance, reason and destination from the previous form.

I am working on the idea that the last persons details (date, distance,
reason and destination) are saved to a temporary table. I would like the
temporary table to be empty the next time the database opens to stop people
entering incorrect information.
If any one could point me in the right direction I would be most grateful.
 
B

Bob Howard

A simpler approach would be to define some global variables within a VBA
module --- one variable for each of the fields. As data for someone is
entered, yoou save the values in these variables. When you open the form
for a new person, give the user a button to copy the data from the prior
person. In the OnClick event for that button, populate the form fields with
the values saved in the global variables.

Of course, if the user exits from the application before using the data,
it'll be lost. The temporary table method would cure this --- but the
global variable approach is really very simple to implement.

Bob (@Martureo.Org)
 
M

Morgan Gartland via AccessMonster.com

Hi bob

Sounds good, but I have only been using access for a little while and not
sure how to go about this. I have a small amount of VBA knowledge. If you
could give me a bit more help it would be much appreciated.

Thanks
Morgan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top