Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From Excel to Access: Functions: How do I use =SUM(A1+10) in Access? W

Status
Not open for further replies.

GNorth

Technical User
Feb 3, 2001
3
AU
I am doing a simple relational database with only 6000 names + street names + etc

In Excel if I want to &quot;modify&quot; the field <PRICE> column C,
I quickly create an other field called <NEW PRICE> column D for example..

At the top of the Field <NEW PRICE> column D, I include the FUNCTION = SUM(D1:D300, +10).

Every cell in column D from 1 to 300 will be updated with +10

I can erase the OLD <PRICE> field (C column) or keep C column for a while.

I know how to do this in Excel. I know which drop menu and menu_commands to clik.

But in Access I am lost.
[ponder] [ponder]

Could anyone explain in details which drop menus/ menu_commands to clik in ACCESS to achieve the same result.

Is there a simple way of doing this in ACCESS.
 
Create a new query and add the table you want to update. Double-click the field (PRICE) you want to update to add it to the design grid. Alter the query type by clicking Query -> Update Query on the menu. Enter a formula in the Update To: field in the grid - try &quot;[PRICE]+10&quot; (you don't want the quotes). Click the run button (exclamation mark icon) to update the data.

Look at the SQL generated by changing the view to SQL. Similar syntax can be used within VBA to achieve the same result. You should see something like &quot;UPDATE MyTable SET Price = Price + 10&quot;. To restrict the affected records (currently it will update every record in the table) you will need to either enter criteria within the design grid, or in SQL append a WHERE clause. e.g. &quot;UPDATE MyTable SET Price = Price + 10 WHERE Price > 50&quot; will only affect records with a price greater than 50.

For further information check out the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top