AllExperts > Experts 
Search      

Using MS Access

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Using MS Access Answers
Question Library

Ask a question about Using MS Access
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Scottgem
Expertise
I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience
I've been designing databases for over 15 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

 
   

You are here:  Experts > Computing/Technology > Business Software > Using MS Access > One-touch replace text

Topic: Using MS Access



Expert: Scottgem
Date: 10/9/2008
Subject: One-touch replace text

Question
QUESTION: In my query, I have the same three character string in multiple fields, which is the key to the query. That is the only thing I change from session to session, as it obviously brings different results each time.

What I would like to be able to do is set it up so all instances of the text change at the same time, instead of me manually changing each one individually.

ANSWER: I'm not following this. Can you post the SQL for your query?


Scott<>
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

---------- FOLLOW-UP ----------

QUESTION: SELECT dbo_INSTRUCTOR.ID, dbo_Name.LAST_FIRST, dbo_Name.CITY, IIf([HISTORY_NATL] Like "*112*","Yes"," ") AS [Has Done It], IIf([Code] Like "*112*","Yes"," ") AS [Fall '08], IIf([POTENTIAL_NATL] Like "*112*","Yes"," ") AS [Willing To]
FROM (dbo_INSTRUCTOR INNER JOIN dbo_Name ON dbo_INSTRUCTOR.ID = dbo_Name.ID) INNER JOIN Master ON dbo_INSTRUCTOR.ID = Master.ID
WHERE (((dbo_INSTRUCTOR.INSTRUCTOR_STATUS)="A") AND ((dbo_INSTRUCTOR.HISTORY_NATL) Like "*112*")) OR (((dbo_INSTRUCTOR.POTENTIAL_NATL) Like "*112*")) OR (((Master.Code) Like "*112*"));


Answer
Ah, OK you want to enter 112 just once instead of having to replace it 6 times. What you need to do is create an unbound form with an unbound text box. You then use the syntax:

Forms!formname!controlname

wherever you want to search for the value entered. For example:

OR (((Master.Code) Like "*" & Forms!formname!controlname & "*"));

hope tis helps,
Scott<>
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA


Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.