Changing date on imported table?

J

JimP

Is it possible to import an object from another mdb and retain the same
modified date?

Currently, importing an object changes the date to the current date.

I would like to use a code loop because there are a number of objects.
 
R

ryguy7272

So, let me get this straight. You are importing to an existing table? The
import process should NOT be converting any dates. Sounds like something
else is going on there; something that you didn’t describe. Anyway, this may
work: go into design view of the table, on the field that causes an issue, go
to Data Type, choose 'Date/Time', Format as Long Date, Medium Date, Short
Date, or a custom date, such as this 'ddd", "mmm d", "yyyy'. That should
take care of the Formatting.

Regards,
Ryan---
 
J

Jim Burke in Novi

It sounds like you're using the transferdatabase command to import obejcts,
right? Are you saying you're importing forms, queres, etc, from another DB,
and want to keep the DateCreated values that they had in the origianl DB? If
so, I don't know of any arguments for the TransferDatabase command (I'm
assuming that's what you're using) that allow you to do anything with that
field. Maybe someone else knows of a way to so this on the import.

You can access the DateCreated property for objects via the CurrentDB
object, e.g. CurrentDB.QueryDefs("myQuery").DateCreated, but once they've
been imported that doesn't do you any good beacuse they will already have
been changed. I'm not even sure that property is updatable. If it is, I can
think of a way to do this, but it might be more trouble than it's worth.
You'd have to get the DateCreated values for the objects in the DB you're
importing from. Create a table in that DB that has object name, object tpye
and DateCreate, fill the table with all values for objects in that DB. Then
import that table along with your other imported objects. You'd need some way
of keeping track of all objecs that are imported, log them, then after all
imports are done, have a routine that , for each newly inported object (hich
you will have logged), finds the object and object type in the table you
created in the other DB and gets the original DateCreated. Like I said, not
sure that would be worth your time! Hopefully someone else knows of a simple
way.
 

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