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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Table from Form

Status
Not open for further replies.

MontgomeryPete

Instructor
Apr 3, 2004
57
0
0
US
I received great help from Remou in the JET SQL/Queries forum and have now correctly calculated a value "fare" for each ride accepted. Normally, I wouldn't want to store calculated values in a database, but the auditors have decided that we need to save the results for audit purposes.

The subform is poplulated by a query. So I have attempted to update the fields from my subform:

Code:
Private Sub Release_AfterUpdate()
UPDATE Ride SET Ride.Fare = Fare WHERE Ride.RideNo = [Forms]![frmSubscriptionRideDetail]![RideNo];
End Sub

However, I keep getting a syntax error. The sub is designed to run after the reservationist completes the order.

Thanks for helping.

Pete

 
You need to actually run a VBA command there. This should work, for example:

Code:
Private Sub Release_AfterUpdate()
DoCmd.RunSql("UPDATE Ride SET Ride.Fare = Fare WHERE Ride.RideNo = [Forms]![frmSubscriptionRideDetail]![RideNo];")
End Sub



-V
 
Are you sure of this ?
SET Ride.Fare = Fare

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks VRoscoli, that got me through the worst part--forgot I needed to execute with VBA. But PHV may be on to something. [Fare] is the name I give to the calculation in the query that populates the subform. [Ride.Fare] is the name in the table.

When I execute the VBA code, I get a prompt
frmSubscriptionRideDetail]![RideNo]

Obviously, the key field is not in memory. I can't understand why unless it has something to do with the query.

Thanks both for helping.






Thank VRoscioli
for this valuable post!


Inappropriate post?
If so, Red Flag it!


Check out the FAQ
area for this forum!



PHV (MIS) 31 Jul 07 9:00
Are you sure of this ?
SET Ride.Fare = Fare
Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?


Thank PHV
for this valuable post!


Inappropriate post?
If so, Red Flag it!


Check out the FAQ
area for this forum!





Click This Banner To Support Our Sponsors
Turn off E-mail Notification. Add This thread To Your Archive E-mail This Thread Top of
Page Next
Thread
Start your own Tek-Tips Group! Click Here!
Home > Forums > Programmers > DBMS Packages > Microsoft: Access Forms Forum
Whitepapers
10 Questions to Ask Your Hosted IP PBX Provider
5 Common VPN Security Mistakes
7 Essential Steps to Achieve, Measure and Prove Optimal Security Risk Reduction
Best Practices in Lifecycle Management: Comparing KACE, Altiris, LANDesk, and Microsoft SMS
Better security for more users - thawte's SGC SuperCert SSL certificates
Building Blocks of Transparent Web Security: Server-Gated Cryptography
Business Enablement with On Demand Vulnerability Management
Certify your Software Integrity with thawte Code Signing
CRM: On-Demand or On-Site? Choose the Right Deployment Option
Don't Wait to Automate: Achieve Immediate Cost, Productivity, and Security Benefits by Automating IT
Dynamic Best Practices of Vulnerability Management
Email Security Comparison Guide
Exploring Exchange Compatible Appliance-Based Messaging - Tolly Group
FREE DEMO: Vulnerability Management & Policy Compliance Overview
Got The Enterprise Software Blues? Appliances Come to the Rescue
Hosted PBX Checklist
How to Offer the Strongest SSL Encryption
IDC Analyst Brief - Taking Content Collaboration to the Next Level
Implementing or Upgrading SAP® Solutions? Don’t Forget the Data
Internet Security Trends for 2007
Introduction to crystalreports.com
IP PBX Systems: Compare the Top 7 Solutions
IP Phones: Compare the 5 Most Popular
Managing the Life Cycle of Encryption Keys with RSA* Key Manager
Maximizing the Business Benefits of Hosted and Managed Email and Email Security Services
Migration to the 2007 Microsoft Office System: A Roadmap for Success
Mirapoint RazorGate Security Appliance Technical Overview
On-Demand Security Audits and Vulnerability Management
OPERATIONALIZING SECURITY & POLICY COMPLIANCE - A Unified Approach for IT, Audit and Operation Teams
Pocket Guide to IP Telephony
Profitable Three-Screen Services: Creating Value for Three-Screen Consumers
QualysGuard PCI Demo
Report Analysis: Lower TCO with 3rd Generation CRM
ROI: Incentive Comp Provides Measurable Results.
Running a Business on Commercial Open Source Software: The Benefits for your Sales Organization
Secure multiple servers
Secure your Apache Server - free trial
Secure your MS IIS Server - a How-To Guide
Socialtext Wikis - Technical Whitepaper
SSL - enabling a trusted digital future for all
SSL in High-Security Browsers
SSL VPN Products Comparison Guide
Taking the Leg-Work out of Systems Provisioning: Best Practices for Reducing Deployment Costs
The Changing Role of Email in the Government Sector - Grey Consulting
The Laws of Vulnerabilities: Six Axioms for Understanding Risk
The Value of Authentication: Learn about the three elements required to create trust on the Internet
Top 5 Things to Know About Hosted PBX Solutions
Using QualysGuard to Meet SOX Compliance & IT Control Objectives
VoIP for Small Business: Compare the Top 9 Vendors
What Every E-Business Should Know about SSL Security and Consumer Trust
Wikinomics - Chapter 9 excerpt from Socialtext
Winning the PCI compliance battle
Worldwide Outbound Content Compliance 2005 – 2009 IDC
(See All Whitepapers)
Tek-Tips Jobs
Job Search
Post Your Resume
Post A Job Opening
Back To Forum
Back To Microsoft: Access Forms
Notify Me
Who's Marked This Thread?
MontgomeryPete
PHV

You have marked this thread for e-mail notification. Click to turn off.
My Archive
Click Here add this thread to your archive.
My Archive
MVPs




 
PHV: Thanks for you patience and taking the time to refer me to documentation.

Pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top