Hi, Gilbert.
In some programming languages, pointers to a variable can be used and your
code would be very close to working. If B were a pointer to an integer and
the name A were substituted for the string "A", then it would work in another
programming language.
In VBA however, there are no pointer data types, so you need to have both
variables defined as the same data type before the value of one of them can
be assigned to the other variable. Additionally, the value assigned to one
of the variables must be assigned prior to this variable being assigned to
the other variable. And since the Eval( ) function needs to be passed a
string expression, then the value of the integer must be converted to a
string before being passed to the Eval( ) function. For an example that
works, try the following code:
Dim A As Integer
Dim B As Integer
A = 10
B = A
MsgBox Eval(CStr(B))
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts, so that all
may benefit by filtering on "Answered questions" and quickly finding the
right answers to similar questions. Remember that the best answers are often
given to those who have a history of rewarding the contributors who have
taken the time to answer questions correctly.