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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB code in a Text Box? 1

Status
Not open for further replies.

Hanss

Technical User
Feb 15, 2001
85
CH
I have a form with two text boxes named

"text1" and "where"

This code will put "2" in "text1":

me.text1 = 2

Question: How can I do this?

Type "me.text1" into the "where" box and VB puts "2" in the "text1" box, not the "where" box.

Many Thanks!
Hanss
Zürich







 
THANK YOU! This works! Just one more question: What should I type in the box if *text1" is on another form?

For example if "text1" was on a form called "form2"

If I type:

Forms![form2]![text1]

into the "where" box I get an error saying that the field cannot be found.

Many Thanks!
Hanss
 
I managed to figure out the answer myself. Simply put the form info where you have the "me".

Many Thanks!
Hanss
 

Also note that Where is a Reserved Word in Accesss and should be avoided as an object name.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top