Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with an update query after importing data from other format

Status
Not open for further replies.

Technyc2003

IS-IT--Management
Feb 10, 2004
39
US
I just converted a dBase database records into an Access table and all went well. I have a field in my database that has an enrollment date for clients. There is another field which calculates that enrollment date and places the results into a due date field. However, I was hoping that after the import it would have done the calculation for me but what I'm doing now is just retyping the Year (i.e. 2/14/2004) and hitting enter and getting my results. Is there an update query I can create that will allow me to do this so I don't have to retype 2500+ records Enrollment Date field? Thank you.

 
It's not clear where things are happenning here. Also what does this mean:
There is another field which calculates that enrollment date and places the results into a due date field.
I thought the enrollment date was coming across from dbase.

What actually do you want calculating and what do you expect to calculate it?

 
The calculation is already programmed, I'm trying to avoid of having to re-enter a date in order to process the calucalation. It's like once I did the import I wanted access to hit enter on all the imported dates so it can perform the calculation automatically.

It's like if you enter a date in your data and it performs a next due date. However, when you import data from let's say and excel sheet it doesn't put the due date because of the After Update code needs to kick in after you hit enter on the date.

 
What I'm hearing is your imported data has a date field but you want another date field that it doesn't have. Separately you have some VBA code that creates the new field if it is entered onto a form you have. What you want to do is apply the VBA logic to a set of records (ie those just imported).

If that is correct, then - yes - you can write an update query that updates all the relevant records. Beyond that you'll need to give us more detail.

 
Yeah I figured it out, took me a while but this is the code I used in an update query.

UPDATE tblmain SET tblmain.FirstProgressDate = DateAdd('m', 3, tblmain.AdmissionDate);


Basically when I imported the data it didn't do it's VBA calculation because it's an After Update code so once you hit enter it does this whole IF..THEN stuff. So I created this query to do it for me and it worked.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top