Update queries

  • Thread starter Thread starter Peter McCartney
  • Start date Start date
P

Peter McCartney

Hello All! Thanking anyone for a reply.A97

I see with update queries once you run them it changes all records within
the table for that field.

Can you run an update query to change 1 specific record only?

Peter McCartney
 
Hello All! Thanking anyone for a reply.A97

I see with update queries once you run them it changes all records within
the table for that field.

Can you run an update query to change 1 specific record only?

One record, ten records, or ten thousand records, sure. Just include
Criteria on the fields which identify the records which you desire to
update. For instance, if there's a numeric Primary Key field and you
want to update some other field in the record with 123 as the Primary
Key, just put 123 on the Criteria line under that field; if you want
to update the salary of the person with EmployeeID 333-33-3333, just
put "333-33-3333" on the Criteria line under the EmployeeID field and
their new salary under the Salary field.
 
If I am using a bound form named [fchange] to enter that criteria would I
put: =[forms]![fchange]![rego] in the criteria section. As I want the user
to input the different criteria?

Peter
 
If I am using a bound form named [fchange] to enter that criteria would I
put: =[forms]![fchange]![rego] in the criteria section. As I want the user
to input the different criteria?

The Forms criterion should work fine. Just put a command button on
fchange to execute the query (you may want to have the code first
check that rego contains valid criteria).
 
Back
Top