| |
You are here: Experts > Computing/Technology > Business Software > Using MS Access > One-touch replace text
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
|
|