Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Update Query
Larry Fisackerly 
      
5 years ago
I have a table with business addresses [Address1]. I need to sort by [Street_Name] only (I have moved the street number to a separate field) so I can drive to them efficiently. Some of the addresses include a Ste at the end of the address.
The problem is when I sort and group by street name, Maple St is considered a different street than Maple St Ste 105.
I have a query that removes the Ste number portion from [Street_Address]. I use StePos: InStr([Street_Name]," Ste ") to determine the position of the Ste portion if present. I use SteRemoved: IIf([StePos]=0,[Street_Name],Left([Street_Name],InStr([Street_Name]," Ste ")-1)) to remove the Ste portion. This is in a Select Query and works perfectly.
The problem is I can not create an Update Query from the Select Query to update the table containing [Street_Name] to show streets with the Ste portion removed. I get a dialog  box Enter Parameter Value for StePos. If I click Ok and run the query, it fills [Street_Name] with blanks. Fortunately, I have backups of everything thanks to your famous slide. How do I create an Update Query using the above expressions to update the table?

I have watched dozens of Update Query videos but none address updating using a calculated field like I am using. Thanks for your help.
Scott Axton  @Reply  
        
5 years ago
Larry -
First I would add two fields.  AddrChanged and Ste (if you don't already have them),  Leave the original data in Street_Address so if it doesn't work as expected you don't goof up your DB.
Second I would work with a copy of the "live" table til you get what you want. a simple CTRL-C CTRL-V in the same DB will make a copy of the data so you can go back easy.

Next are you putting the formulas that work (with out the alias ie "SteRemoved:" in the update criteria?
Are you putting the formula from the working Select in the update or trying to use the alias?  Don't use the alias - the query doesn't know what that is yet until it is run.  That is most likely where you are getting the Enter Parameter Value

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 9:36:38 PM. PLT: 1s