adding an update query to my module code

D

DanRoy

I have 2 tables, A & B. Table a has 5 fields with field2 being "date".
Table B has 10 fields, with field8 being Start and field10 being Finish. In
the relationships, I established 1-to-many relationships for both date and
Start in Table A1, and date and Finish in Table A2 in the relationship
screens.

In Table A, I have in field 5 a numeric equivilent to a work day reference,
relative to the calendar date. By relating the Start and Finish to a work
Calendar, I can calculate working durations between the dates. I established
updateQueries for both the Start and Finish fields by adding 2 new fields,
Start_WD and Finish_WD.
In my UpdateQuery, I am updating the Start_WD and Finish_WD fields with the
WorkIndex field in Table A based on the Joined field Date<->Start and
Date<->Finish lookups. My update queries are working fine manually, but I
would like to run them from my code in a vba procedure.

Do I need to come with an SQL statement which does the same as the
UpdateQuery, or can I simply call the UpdateQuery from inside of my procedure?

I tried the DoCmd.RunQuery "qryUpdateLREStart, , acEdit" but it gave me a
compile error. I done lots of internet research but with little success.

Can you provide an example Access VBA example with a query name of
qryUpdateLREStart?

Dan
 

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