Solved

MS Access saving a variable name within a string in a field

Posted on 2014-04-23
2
406 Views
Last Modified: 2014-04-24
Hi

I would like to save the name of a variable within a string saved in a field.  I would then like to retrieve the string value within a procedure and use the string/variable concatenation as if written in the procedure itself.

So for example...

Value saved in field = "There are " & varNumber & " days to go"

The procedure where used has a variable varNumber which has a value (eg 3)

The field value is then retrieved (via DLookup for example) and thus the string them reads...

There are 3 days to go


Is this possible and if so what is the correct syntax?

Many thanks
0
Comment
Question by:kenabbott
2 Comments
 
LVL 28

Accepted Solution

by:
omgang earned 500 total points
ID: 40018123
You can accomplish this by creating a Function to return the value of the variable.  You use the function call in the field

Function GetVariable() As Integer
   
    GetVariable = varNumber

End Function

Then in your field
"There are " & GetVariable() & " days to go"

OM Gang
0
 

Author Comment

by:kenabbott
ID: 40019675
Many thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now