×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to enter text in TextBox?

How to enter text in TextBox?

How to enter text in TextBox?

(OP)
Hallo, I'm want to enter a text in text property of TextBox. I read help exampels and using the following part of cod
  Sub Eltablo()
    Dim Trafopost, Izvod As String
    Dim StalbNomer, TabloNomer As String
    Dim tipTablo As String
    Dim EPN As String
    Dim Electromer, Tok As String
    Dim Chasovnik, ChasovnikNomer As String
    Dim Tarifi, Fasa, TT, NT As String
    
    Trafopost = "TP 1"
    Izvod = "A"
    StalbNomer = "1"
    TabloNomer = "1"
    tipTablo = "TEMO 1M"
    
    txtTrafopost.Text = Trafopost
    txtIzvod.Text = Izvod
    txtTablo.Text = tipTablo
    txtStalb.Text = StalbNomer
    txtTablo.Text = TabloNomer
    
  End Sub
but it does not work.
Pleas tell me why?

RE: How to enter text in TextBox?

There is a few points:

CODE

Dim Trafopost, Izvod As String
will Dim Trafopost as a Variant and Izvod as a String.

CODE

txtTablo.Text = tipTablo
    txtStalb.Text = StalbNomer
    txtTablo.Text = TabloNomer
is overwriting the value in txtTablo from tipTablo to TabloNomer

Is this Word VBA? The code works fine for me - where is the Sub and how are you calling it?

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

RE: How to enter text in TextBox?

(OP)
Thank you for answer. This is AutoCad VBA and I found my mistace. This realy works fine.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources