Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2004, 09:26 AM
V V is offline
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default subform functions

Hi,

Latest problem I have is within a subform. I have a function that updates another field depending on its pulldown selection. It works but the function updates ALL records displayed in the subform. How does one specify that current record in the subform to be updated?

Thanks



 
Old April 25th, 2004, 11:05 PM
Authorized User
 
Join Date: Mar 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You have to us a key on the table and refer to it in a WHERE clause.

For example:
UPDATE Table1 Set Field1 = Field2 WHERE Table1.Key = key

Note the above example is SQL server syntax Access SQL is different..

Hope this helps??
-Chris


 
Old April 26th, 2004, 05:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

If not more than one table involved, you can directly use the column name.

UPDATE Table_Name Set Field_tobeUpdated = Its_Value WHERE KeyField = keyValue

HTH
Cheers!

-Vijay G





Similar Threads
Thread Thread Starter Forum Replies Last Post
subform jeremy1048 Access 0 May 2nd, 2008 09:03 AM
Functions LTello BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 September 15th, 2006 11:15 AM
Functions czambran BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 13 July 11th, 2006 06:33 PM
Filter Subform B Based on Field in Subform A SerranoG Access VBA 3 June 18th, 2004 12:23 AM
Help with Functions megabytes C# 1 August 7th, 2003 12:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.