Timestamping an Import

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a command button that runs code to import a text file. I want
to capture a timestamp for the last time the text file was imported
and display that on a form. I tried to write to an unbound text box on
the form, using the now() function, and it works initially, but when
the form is closed, the value is not retained. The next time the form
is opened, the unbound text box is Null.

Any ideas,

Dave
 
hi,
unbound control are not known for holding data.
you best bet is to put the time stamp in a table, either
your import table or a special table that just hold the
timestamp. then call the timestamp to the form when you
call the other data. update or append the timestamp at
next import.
 
If you only want to display the last import date during the duration of an
Access session you can define a Global variable to store the timestamp.

But once Access is shutdown that value would be lost. I suspect you want to
display the value each time a user runs the application.

You need to permanently store the value in a new table, bind the table to
the form, bind the field to the textbox and update it with Now() whenever a
new import is complete. Then when you close the form the new value will
replace the old value in the table.
 
I have an idea which you might try out. The idea to retain the value in the
unbound text box is to store it into a public variable (if you wish to have
the timestamp to last for the duration of the execution of the application)
or store the value into a table and load the value every time you load the
form.

Your help and assistance is solicited and is precious to me.
Sincerely yours,
Satadru.
 
Satadru Sengupta said:
I have an idea which you might try out. The idea to retain the value in the
unbound text box is to store it into a public variable (if you wish to have
the timestamp to last for the duration of the execution of the application)
or store the value into a table and load the value every time you load the
form.

Your help and assistance is solicited and is precious to me.
Sincerely yours,
Satadru.

Thanks for the help eveyone. I created a table and used an update
query to update the timestamp for each import.
 
Back
Top