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 December 6th, 2008, 10:49 PM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Referencing Data in Subforms

I want to set a value equal to the value in field SparePartsID that is on subform sfJpbSpareParts that is embedded in form fMaintRequest and can not seem to get the syntax correct. Can anyone be of help? Thanks.

 
Old December 7th, 2008, 03:20 PM
Authorized User
 
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This link should help:
http://www.mvps.org/access/forms/frm0031.htm

HTH RuralGuy (RG for short) aka Allan Bunch MS Access MVP 2007 acXP WinXP Pro
 
Old December 7th, 2008, 10:07 PM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

YES IT DID!!! Thank you so very much. I was totally "stuck" on this issue. I have to go find my cat now, I think that I scared him when I did the Happy Dance after this code worked:

Dim SQL_Text As String
    SQL_Text = "UPDATE tSpareParts SET [tSpareParts]![SP_Units_On_Hand] = [tSpareParts]![SP_Units_On_Hand] - Forms!fMaintrequest!sfJobSpareParts.Form!SparePart sUsed WHERE [tSpareParts]![SP_Part_Number] = Forms!fMaintrequest!sfJobSpareParts.Form![SparePartsID]"
DoCmd.RunSQL (SQL_Text)



 
Old December 13th, 2008, 07:34 PM
Authorized User
 
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Glad I could help.
__________________
HTH RuralGuy (RG for short) aka Allan Bunch MS Access MVP 2007 acXP WinXP Pro





Similar Threads
Thread Thread Starter Forum Replies Last Post
Referencing data on external drive startfarm ASP.NET 2.0 Basics 4 June 9th, 2008 06:20 PM
Datatables - referencing the data in VB Code Juan Patrick Visual Basic 2005 Basics 4 July 2nd, 2007 10:19 PM
Subforms 150563a Access 1 June 29th, 2007 04:57 AM
Populating data in subforms michayos Infopath 0 May 25th, 2007 10:40 AM
subforms ajmil11 Access 2 January 19th, 2006 11:16 PM





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