Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to parse a string to code...I think

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I have a string which is derived from two text boxs
and stored in a third textbox

Me![form_name] = "form1"
Me![field] = "field1"

(code to store two fields in a third)
[addy] = "Forms![" & Me![form_name] & "]![" & Me![field] & "] = (2*Combo8/10)"

my problem is that now I Have a line of code as a string:
forms![form1]![field1] = (2*combo8/10)

HOW DO I now get this string from a string to a line of code????
 
What kind of VBA code do you want to write once the string is parsed? An SQL statement in VBA?
 
I'm in access 97 and I'm doing it on a when button clicked sub.

soooo VBA.

THANKYOUTHANKYOU THANKYOU for you help
 
Obviously it's vba but what are you going to get the VBA to do?
 
I want to assign the value of the combo8*2/10 (which I realize is just /5) to field1 in form1. The problem is that form1 and field1 are going to change, that's why I'm trying to do it this way....am I totally off base ??? or what?
 
I suggest that you use the expression builder for this.

Open up the properties of the [addy] text box, select the 'Control Source' and then a small button with three dots on it will appear next to the control source field. Click this button.

You will enter an interface where you can easily select the fields, functions, etc used to derive the contents of [addy].

You could then copy the generated code into your VBA and paste it wherever you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top