Selecting Multiple Records then Changing Data

Brian100x

New member
Local time
Today, 16:42
Joined
Jun 20, 2001
Messages
8
I have a contionus form bound to a select query for a table. In the table I have a Yes/No field. I want to be able to select a range of records in the form, then update the YES/no field to yes for the selected records. A similar effect as highlighting 5 records then hiting the delete key. I have tried to figure this out for a couple of days and I'm at a loss on how to do it. I would appericate any sugestions.

Brian
 
Have you tried to do something with an iff statement.

You could possibily update your records by doing something like iff([Field Name]=no,yes,)

Sorry I can't offer a more complete answer, but it might point you in the right direction of something you haven't tried yet.

Good luck.
Peter
 
I thought about using an iff statement. The problem I am running into is how to identify whish records were selected by the user. If I have 50 records that display on the form, and I only want to select records 25-31, I can highlight the record selectors for the records that I want to change the data in. I was thinking about using a recordset to identfy the records then us a loop to change the data in those records. However I can not figure out how to identfy the selected records to declare the recordset.
 
Instead of doing a loop consider using an update query to change the "yes/no" field to what you want.

As you indicate the trick is to idenfity the specific records to be updated.

If I understand correctly what you are trying to do is you have certain records in your database that are set to "no". You can easily get these by doing an query.

However, of these records (let say 50 records), you only want to switch numbers 25 - 31 from "no" to "yes".

If this is correct, the only way I can think of to automate the update is if you can uniquely idenfity records 25 - 31 (such as through date, time, a primary field, who entered the data, etc...)? Without a common link between these records I don't think it is possible.

It might help if you provide more details on what fields there are to work form and why only these certain records need to be updated.

Peter.
 
Runing a query is not an option there is not a way to identify records 25-31 from the rest of the records. What I am trying to do is simlar to what happens when you use delete records. I can slect records 25 through 31 by clicking on the record selector for number 25 then holding the shift key and clicking on the record selector for number 31. Then if I press the delete key or go (Edit-Delete Record) all 6 records will be deleted. What I need is a way to identfy those 6 records, like access does, after they have been selected.

Brian
 

Users who are viewing this thread

Back
Top Bottom