how to update all fields in table in one go?

J

Jon

Hi,

I have a table for salary of employees, and I have a form (single form) that
shows employee ID , name , salary, and salary date. In this form , there is a
check box that I want it to put today's date in the field "salary Date" for
all records of salary date of all employees if the user checked it out in one
go. It is hard that I should put for each employee record today date
individually.

Any help please??
 
J

Jerry Whittle

THIS IS IMPORTANT: First make a backup of the table, or better yet, the
entire database file.

Create a query based on the table in question. Select both the "check box"
and "salary Date" fields. Also add in any other fields that may help you
identify the records such as Names.

In the criteria for the "check box" field put Yes. Make sure that Access
does NOT put quotation marks around it. Run the query to make sure that you
are only getting the records that you expect.

If you are seeing the proper records, go back to design mode. Assuming
Access 2003 or earlier, go up to Query then select Update. In the Update To
row of the "salary Date" field, put in the following. Make sure that Access
does not put quotation marks around it.

Date()

Run the query and it should warn you that it's about to update X number of
records.
 
J

Jon

Thank you Jerry.
but the check box is unbound.

Jerry Whittle said:
THIS IS IMPORTANT: First make a backup of the table, or better yet, the
entire database file.

Create a query based on the table in question. Select both the "check box"
and "salary Date" fields. Also add in any other fields that may help you
identify the records such as Names.

In the criteria for the "check box" field put Yes. Make sure that Access
does NOT put quotation marks around it. Run the query to make sure that you
are only getting the records that you expect.

If you are seeing the proper records, go back to design mode. Assuming
Access 2003 or earlier, go up to Query then select Update. In the Update To
row of the "salary Date" field, put in the following. Make sure that Access
does not put quotation marks around it.

Date()

Run the query and it should warn you that it's about to update X number of
records.
 

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

Similar Threads

Lookup Field Update Problem 4
how to subtract from field in table 2
Query 2
Set Value Macro 2
How to find the 2nd max salary? 1
Joining Form with Subform 2
Employee Time calculating and tracking 1
Lookup 2

Top