Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access Escape characters

Posted on 2011-03-15
9
Medium Priority
?
588 Views
Last Modified: 2013-11-28
Im trying to find out the correct escape codes to insert values in my memo fields

The memo field would look something like this
Hello Forms![frm_sales]![firstname],  I called and left you a voice mail a few weeks back
If I msgbox or have the code email this field out, I would like it to read
Hello Joe,  I called and left you a voice mail a few weeks back


I cant field the correct escape code to replace the field name with the actual value.. Any help would be greatly appreciated

Thanks
0
Comment
Question by:joein610
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35137194

Dim msg As String

msg = "Hello " & Forms![frm_sales]![firstname] & ", I called and left you a voice mail a few weeks back"

MsgBox msg
0
 

Author Comment

by:joein610
ID: 35137339
That the code works if it place that syntax in VBA editor.. but in this instance the memo field contains..
"Hello " & Forms![frm_sales]![firstname] & ", I called and left you a voice mail a few weeks back"


If I msgbox me!memo1  I get the same text as in the memo field
"Hello " & Forms![frm_sales]![firstname] & ", I called and left you a voice mail a few weeks back"


0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35137376
do you mean you entered these

"Hello " & Forms![frm_sales]![firstname] & ", I called and left you a voice mail a few weeks back"

in the table?
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

Author Comment

by:joein610
ID: 35137404
Correct... sorry for the confusion
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35137494
if you really want this to come from table fields, add another field, say greeting (text)

enter
Hello in greeting field

enter
I called and left you a voice mail a few weeks back    in memo field

add the greeting field to your form, now you can do this


msgbox  me.greeting & " " & Forms![frm_sales]![firstname] & ", " & Me.memo
0
 

Author Comment

by:joein610
ID: 35137806
Gotcha... Thanks what I have now..  I must of been too was optimistic that there was something better :)

Thanks For your help!
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 35138243
You're looking to include "tokens" or "placeholders" in your Memo field - in other words, you wish to have Text in the Memo field that could be used when generating a message, and you want that Text to dynamically grab the data from frm_sales? If so, then you can do this using specialized coding and placeholders. Enclose all of your placeholders in some unique syntax (for example: <CustName>).

When you need to use this Text value, add it to the form/report (or whatever object you need) and then build a routine that uses the Replace function to input your data:

Me.YourTextField = Replace("<CustName>", Forms("frm_Sales").CustomerName)

And so on for all your "tokens".
0
 

Author Comment

by:joein610
ID: 35138477
Let me try that...--  Sound pretty decent .. .. and I can prob make it compatible with my php programmers code.
0
 

Author Closing Comment

by:joein610
ID: 35139331
I had a slight error with arguments because the orgianl field name  was missing, so i replace the code with

me!Me.YourTextField = Replace(Me.YourTextField, abc, "{first}", Forms![frm_sales]!CustomerName)


THANKS!!
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question