updating multiple records

iangirven

Registered User.
Local time
Today, 21:37
Joined
Mar 22, 2002
Messages
71
Evening all,

its been a while since ive been here and yet again i need your help.

I have a form listing a number of employees, using a unique employee ID number.

At the moment when i want to update their records with user preset data the user just double clicks the employee ID number.

I want to speede this up by adding a true false check box and a command button. when the user clicks teh command button it would update the records for those users with teh check box set to true.

I want the records to be updated as quickly as possible. The only method i can remember is by cycling through the underlying table until each employee ID is found then update it. There are approx 1500 employees so if i want to update 10 of them it will take a while cycling through the table to find the matching records.

could sopmeone please remind me how i can directly update the record without cycling through the table ( using a loop that starting at the first record and moving onto the next record at each iteration of the loop).

The database is currently in access 2000

Ive had a look at previous posts but cant seem to find anything that will help.

thanx in advance

Ian
 
Your update query should have the criteria set to -1 [true] to only update the records that have the check box selected.
 
thanks for the prompt reply.

I dont have a problem using VBA to actually update the records. i just cant seem to remember how to select the individual records, directly, using VBA code.

eg. if i want to update the records of the employee IDs 8888, 9999, 1010,1212, etc how can i go directly to each one instead of looping through the full table until i find the record that matches.

what i would like to do is set up a loop based upon the number of employees selected (in the above case 4), using the employeeID.
eg.
load the relevant table.
start loop iterating to match the number of employees selected.
update employeeID record
next iteration of the loop

the premis seems pretty basic but i cant remember how to put it into code. perhaps i need to use some SQL with it?

i am probably overcomplicating things again and havent doen any coding for a few months, which doesnt help.

thanx again

ian
 
Pat,

Thanks for the information. I forgot to include the fact that i would be updating multiple tables and the number of records to be updated would range from 1 to about 15. would the update query still be a viable option in this case?

regards

ian
 
Pat,
Thanks again for the information. I have had a play with update queries today. Much easier than the coding I was trying to remember.

cheers.
ian
 

Users who are viewing this thread

Back
Top Bottom