variable question

J

Joe

How can I get the contents of a variable? I am using MS
Access 2002.

Dim Var1 as String
Dim Var2 as String

Var1 = mid(parm1,4,30) 'parm1= "....[forms]![frm1]![ctr1]

above code returns a string of "[forms]![frm1]![ctr1]" and
assigned to Var1. What I want is the contents of [forms]!
[frm1]![ctr]

Var1 = [forms]![frm1]![ctr1]

This code works and is returing the value of variable ctr1
to Var1.

Can anyone help? Thanks in advance.
 
J

John Vinson

above code returns a string of "[forms]![frm1]![ctr1]" and
assigned to Var1. What I want is the contents of [forms]!
[frm1]![ctr]
Var1 = Eval([forms]![frm1]![ctr1])
 
T

Tim Ferguson

above code returns a string of "[forms]![frm1]![ctr1]" and
assigned to Var1. What I want is the contents of [forms]!
[frm1]![ctr]

Why mess around with strings: can't you simply pass the Control object
itself, and then use the .Value property?


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top